How to send validation email without going into the spam folder?

孤街浪徒 提交于 2020-01-11 10:52:28

问题


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 thought of a solution that is to use an "external service" to send my email instead of simply sending it via the mail function in PHP.

Question : 1) What external service should I use (I guess it would requires to have an API)?


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/5169354/how-to-send-validation-email-without-going-into-the-spam-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!