简体   繁体   English

帐户确认电子邮件作为垃圾邮件发送

[英]Account confirmation email sent as SPAM

I am using PHPMailer to send a confirmation email for newly registered users in my social network. 我正在使用PHPMailer为我社交网络中新注册的用户发送确认电子邮件。 But I found out most of them have ended up in user's spam list. 但我发现他们中的大多数都已经进入了用户的垃圾邮件列表。 (Hotmail and Yahoo). (Hotmail和Yahoo)。 How to avoid this? 怎么避免这个?

This is my script 这是我的剧本

$mail=new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = mSMTPAuth(); 
$mail->SMTPSecure = mSMTPSecure(); 
$mail->Host = mHost(); 
$mail->Port = mPort(); 
$mail->Username = mUsername(); 
$mail->Password = mPassword(); 
$mail->From = mFrom();
$mail->FromName = "SiteName";
$mail->Subject = "SiteName New Account Activation";
$mail->IsHTML(true); 
$mail->WordWrap = 50;       

$mail->Body = "<h2>Welcome to " .$sitename. " " .$username. "! </h2><br><br>";
$mail->Body .= "Please click on the link below to verify your email address:<br><br>";
$mail->Body .= "<a href='".$base. "verify.php?a=" .$gen_key."'>".$base. "verify.php?a=" .$gen_key."</a>";
$mail->Body .= "<br><br>Regards<br>";

$mail->AltBody = "Welcome to " .$sitename. " " .$username. "!\n\nTo verify your email address, please click on the link below:\n\n".$base. "verify.php?a=" .$gen_key;

$mail->AddAddress($email);
$mail->Send();
$mail->ClearAddresses();

To maximize the odds of your email arriving, there are three things you need to check: 为了最大化您的电子邮件到达的几率,您需要检查三件事:

  1. Make sure the computer sending the email has a Reverse PTR record 确保发送电子邮件的计算机具有反向PTR记录
  2. Configure DomainKeys Identified Mail (DKIM) in your DNS and code 在DNS和代码中配置DomainKeys Identified Mail(DKIM)
  3. Set up a SenderID record in your DNS 在DNS中设置SenderID记录

details at: 详细信息:

http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html

There's not much you can do about it. 你无能为力。 Most of those mail providers have lists of common IP addresses, hostnames, and other data that often get flagged as spam and if your emails match the criteria they automatically get filtered. 大多数邮件提供商都有常见IP地址,主机名和其他数据的列表,这些数据通常被标记为垃圾邮件,如果您的电子邮件符合条件,则会自动过滤掉。 All you can really do is tell your visitors to add your email address to their allow list before registering so the email will go through to their inbox. 您真正要做的就是告诉访问者在注册之前将您的电子邮件地址添加到他们的允许列表中,以便电子邮件进入他们的收件箱。

Honestly, don't worry about it. 老实说,不要担心。 If they see your emails are regularly being marked as 'not spam' then they'll eventually add an exception for it. 如果他们看到您的电子邮件经常被标记为“非垃圾邮件”,那么他们最终会为其添加例外。 Just tell users to check their spam folder if they don't see the email like every other site does. 如果他们没有像其他网站那样看到电子邮件,请告诉用户检查他们的垃圾邮件文件夹。 Usually if they mark it as 'not spam' in that folder it will automatically add an exception for that address so any other emails you send them will end up in their inbox. 通常,如果他们在该文件夹中将其标记为“非垃圾邮件”,则会自动为该地址添加例外,因此您发送的任何其他电子邮件将最终出现在其收件箱中。

Do you have a reverse DNS entry for the server sending the confirmation e-mails? 您是否有发送确认电子邮件的服务器的反向DNS条目?

If not, this might be a rDNS issue . 如果没有,这可能是一个rDNS问题 Some sites are much more likely to mark a message as SPAM if the IP and name of the sending host don't match according to rDNS. 如果发送主机的IP和名称根据rDNS不匹配,则某些站点更有可能将消息标记为垃圾邮件。

Otherwise, you might try sending confirmation e-mails to your own accounts on major e-mail sites like yahoo, hotmail and g-mail and then tweaking the wording until it gets past the spam filters. 否则,您可能会尝试在雅虎,hotmail和g-mail等主要电子邮件网站上向您自己的帐户发送确认电子邮件,然后调整措辞,直到它通过垃圾邮件过滤器。

Hm, there is SOMETHING you can do: * Scrap the HTML. 嗯,你可以做一些事情:*废弃HTML。 This looks like spam, especially with low text * Write some more text, please. 这看起来像垃圾邮件,特别是低文本*请写一些更多的文字。

Short HTML mails may rise up quite on the spam list. 短信HTML邮件可能会在垃圾邮件列表中上升。

I discovered that any variation of the word "confirm" in the title ends up in my spam bucket. 我发现标题中“确认”一词的任何变体都会在我的垃圾邮件桶中出现。 I found other words that also do this: "purchase", "hurry", "order", "bargain", and "imminent". 我发现其他的话也是这样做的:“购买”,“快点”,“订单”,“讨价还价”和“迫在眉睫”。

This may not be true in all emails, but it happens in mine. 这在所有电子邮件中可能都不是这样,但它发生在我的电子邮件中。 It may be because those words appear in most of the emails I mark as span. 可能是因为这些单词出现在我标记为跨度的大多数电子邮件中。 It also may be that a local sysop made a filter and distributed it to all of us. 它也可能是本地sysop制作过滤器并将其分发给我们所有人。

You can try using sendGrid apis which will helps, they charge but I think it is worthy. 您可以尝试使用sendGrid apis ,这将有所帮助,他们收费,但我认为它是值得的。 They support most popular languages : Nodejs, PHP, Java, .... 它们支持大多数流行语言:Nodejs,PHP,Java,....

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM