问题
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