I know that in first look many users mark this question as duplicate, but after reading more than 10 question I did not get any satisfactory answer, almost all question has
I know this already has an accepted answer but this is for others who might have had the same problem like me and ended up here. I had a website and mails send from my website ended up in spam boxes. Even if I tried using phpmailer and adding our companies mail-server as an SMTP.
However this could easily be resolved by sort of white listing the IP address of the website to the send filter of your mail server. How this is done exactly I don't know because the admin of the mail server did this for me(google it I guess).
Doing this means that if the receiving side does a DNS lookup or an IP lookup to your mail server. The mail-server tells the receiving side that it indeed was sent from him or his associating IP addresses and therefor it will not end up in the spambox.
However if you do this there is no need for the phpmailer and the standard mail() function works too.