我的网站电子邮件将转到 gmail 中的垃圾邮件

My website emails are going to Spam in gmail

我有一个提供每日房地产更新的网站。用户注册后,我们每天都会向他们发送电子邮件。但是,Gmail 将我们所有的电子邮件标记为垃圾邮件。我们应该注意什么?

垃圾邮件基于服务器、域和黑名单历史记录。

这是由服务提供商控制的,老实说,您无能为力。

最好的办法是将发件人电子邮件添加到您的安全列表,即 no-reply@example.com

Due to the simplicity of PHP, it is very easy to send a mail through mail(), however there is 99% of chances that you are doing it wrong. You need to follow the right guidelines to use mail(). My recommendation is use a third party mail service like Mandrill

如果您仍然选择继续 php mail(),请遵循以下指南,这将帮助您一定程度地扩展。

Set the right Headers:

 $headers .= 'From: YourLogoName info@domain.com' . "\r\n" ;
 $headers .= 'Reply-To: '. $to . "\r\n" ;
 $headers .='X-Mailer: PHP/' . phpversion();
 $headers .= "MIME-Version: 1.0\r\n";
 $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

 $to = to@hello.com;
 $subject = subject ;
 $body = "<div> Email body goes here.. </div>";  
 mail($to, $subject, $body,$headers);

Message Sender Domain and Server Domain Should Match

垃圾邮件发送者因从一台服务器发送电子邮件并试图让收件人相信它来自其他地方而臭名昭著。因此,如果您从 sender@yourdomain.com 发送电子邮件,最好将脚本驻留在 example.com.

The Server is not Blacklisted

当一台服务器被列入黑名单时,这意味着该服务器已被识别为发送了大量垃圾邮件的服务器。这会导致收件人邮件服务器拒绝或过滤从该服务器收到的任何邮件。