Spam problem

Anyone has experience with hosting emails to Mails generated by JavaScript, for example. changes in orders us fall into the spam. I am using PHP, SMTP for sending. I dont know how to make it work in combination with outlook.

Possible is someone hosting mails in Google? How then adjust the sending Script?

Before that, we had mails on its own server, but on the gmail accounts everything fell into spam.