使用PHPMailer导致许多被阻止的电子邮件 [英] Using PHPMailer Results in many blocked emails

查看:180
本文介绍了使用PHPMailer导致许多被阻止的电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PHPmailer;虽然可能是2012年的版本-我已经有一段时间没有更新了.

I am using PHPmailer; though probably a version from 2012 - I haven't updated it for a while.

我正在这样发送邮件:

        $mail = new PHPMailer();
        $mail -> IsSMTP();
        $mail -> Host = "localhost";
        $mail -> Port = 587;
        $mail -> SMTPAuth = true;
        $mail -> Username = EMAIL_USER;
        $mail -> Password = EMAIL_PASS;
        $mail -> From = EMAIL_USER;
        $mail -> FromName = "My Company";
        $mail -> AddAddress($email);  
        $mail -> AddReplyTo('<Same as "FROM">', 'User Name');
        $mail -> IsHTML(true);
        $mail -> Subject = 'This is my subject';
        $mail -> Body = $body;
        $result = $mail -> Send();

我有很多电子邮件都使用上述代码反弹.我什至删除了body变量,然后在其中进行了硬编码的测试",所以我认为我的身体不是原因.

I have had many emails bounce back using the above code. I even removed the body variable and just hard coded "test" in there -- so I don't think my body is the cause.

我想知道是否还有其他我不使用的标头会有所帮助,还是PHPMailer在后台处理此标头?

I am wondering if there are other headers that I am not using that would help or does PHPMailer take care of this behind the scene?

编辑:我真的是在问我是否缺少任何重要的标题信息吗?

EDIT: I am really asking if I a missing any important header information?

推荐答案

好,我解决了这个问题;上面的代码不是问题,可以很好地工作.

Well I solved the issue; the code above was not the problem and works great.

在我的主题中,我使用了一个有关验证您的帐户信息"的短语,但该短语在一些ISP上被屏蔽了.

In my subject, I used a phrase regarding "verify your account information" and that got it blocked on a few ISP's.

因此,本课非常重要.在意识到这一点之前,我一直在看自己的php代码和身体内容.

So the lesson is, your subject matters. I was looking at my php code and my body content before I realized this.

这篇关于使用PHPMailer导致许多被阻止的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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