phpMailer gmail垃圾邮件 [英] phpMailer gmail spam

查看:133
本文介绍了phpMailer gmail垃圾邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用phpMailer,但是我有一个问题:当收件人是Gmail或Yahoo时,我的电子邮件最终位于垃圾邮件文件夹中.这怎么可能? 代码是这样的:

I use phpMailer, but I have a problem: when the recipient is Gmail or Yahoo my email ends up in the spam folder. How is it possible? The code is this:

        $mail->AddCustomHeader('Reply-to:info@myemal.com'); 
        $mail->From="info@myemal.com";
        $mail->FromName="MY NAME";  

        $mail->IsSendmail(); 

        $mail->AddReplyTo("info@myemail.com");

        $mail->From       = 'info@myemail.com';
        $mail->FromName   = 'My name';
        $mail->AddAddress($to, $toName);
        $mail->Subject  = $subject;
        $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; 
        $mail->WordWrap   = 80; // set word wrap
        $body->'Hello';
        $mail->MsgHTML($body);
        $mail->IsHTML(true); // send as HTML

推荐答案

这是一个复杂的问题.有很多事情可能出错,但是您应该考虑以下几点:

This is a complex question. There are a lot of things that can go wrong, but here's a few things you should think about:

  1. 您从何处发送电子邮件.不要指望能够从家庭ADSL线路上获得良好的效果,因为大多数邮件服务器都会查看邮件是否来自为这种用途分配的网块.来自此类来源的大多数邮件都是垃圾邮件.使用 http://www.anti-abuse.org/之类的工具查找IP multi-rbl-check/ http://spameatingmonkey.com/lookup .

表现良好.建立一个良好的邮件发件人声誉需要花费一些时间,如果您的举止不当,将会失去它.如果您的服务器被黑客入侵并用于发送垃圾邮件,那也无济于事.

Behave yourself. It takes a while to build a good reputation as a mail sender, and if you misbehave you'll lose it. If your server is hacked and used to send spam, that won't help much either.

签署您的电子邮件.这是一个很大的主题,但是您需要的关键字是SPF和DKIM.现在也是DMARC.

Sign your emails. This is a big topic, but the keywords you need are SPF and DKIM. And now also DMARC.

将批量电子邮件标记为批量(例如,标题优先级:列表")

Mark bulk email as bulk (eg Header "Precedence: list")

为您的用户提供取消订阅机制,并在列表取消订阅"标头中进行广告.

Provide an unsubscribe mechanism for your users, and advertise it in a "List-Unsubscribe" header.

如果可能,请在收件人的Web界面中查看gmail对标为垃圾邮件的邮件所说的内容.查看其身份验证结果"标头,以检查您的SPF和DKIM签名是否正常运行.阅读google和yahoo网站上有关如何不被视为垃圾邮件的所有建议.例如,通过Gmail邮箱中的邮件中的链接进行链接.

If possible, Look at what gmail says about the messages marked as spam, within the web interface of the recipient. Look at their "Authentication-Results" header to check that your SPF and DKIM signing is working. Read all the suggestions on google and yahoo's sites about how not to get treated as spam. eg follow the link from on of your messages in a gmail mailbox.

如果您不想处理所有这些问题,请考虑通过信誉良好的smtp服务器发送邮件.如果您只是发送一些电子邮件,则托管服务提供商(如果您在家中,则是您的isp)可能会提供合适的smtp服务器,您可以通过适当的身份验证对其进行访问.您甚至可能体积很小,无法通过gmail的服务器进行发送(尽管它们会重写您的发件人"地址以匹配您的gmail帐户).对于商业量,您可能需要考虑使用专门从事这类事情的商业smtp服务提供商.除了帮助您掌握获得高送达率所需要做的所有事情之外,它们还可以通过跟踪实际打开电子邮件并单击链接的用户数量以及清除不良用户的工具提供很多帮助您列表中的电子邮件地址.

If you don't want to deal with all of this, consider sending your mail through a reputable smtp server. If you're just sending a little bit of email, your hosting provider (or your isp if you're doing this from home) might provide a suitable smtp server, which you can access with suitable authentication. You might even have a small enough volume to send through something like gmail's servers (though they will rewrite your From address to match your gmail account). For commercial volumes you might want to consider using a commercial smtp service provider that specialises in this sort of thing. Besides helping you stay on top of all the things you need to do to get a good delivery rate, they'll also help a lot with tools for tracking how many of your users are actually opening emails and clicking on links, and for removing bad email addresses from your lists.

这篇关于phpMailer gmail垃圾邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆