Gmail and hotmail have notoriously strong spam filters. The best solution is to use a service like:
https://www.mail-tester.com/
to test your email for why it would be spam blocked and fix the issues. Most likely you will need to set up SPF records and DKIM on your server in order to improve deliver-ability.
You might even try using SMTP to send the email instead of the simple mail service. Using a real FROM address that is registered on your server with authenticated SMTP will often improve your spam score as well.