I have a PHP website that send a validation code when a new account is created.
My problem is since few months, a lot of those email goes in the spam folder.
I t
Have a look at this documentation from Google. It involves your network support including reverse lookup and Domain keys to be present. I think most of the email servers would have similar requisites.
Many times, when using the builtin mail
function, the configuration isn't set up to help prevent this from happening. The reason is the Received header is set to an internal IP address, like 192.168.x.x which is used as an indicator to most spam filters. You may want to try finding a simple SMTP class that connects remotely so the headers get set properly.
Try using your ISP's or company's server as a relay. Use a sending address which exists, so that validation can be done on it, and bounces sent back to it. You may want to setup a separate domain for verification such as verification.example.com
. You could then send the validation message from application@verification.example.com
. Replace application and example as appropriate.
You may also want to look at https://serverfault.com/questions/241189/email-delivery-management-grievances#241260.