PHPMailer - 邮件直接发送到垃圾邮件 [英] PHPMailer - mails going straight to spam

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

问题描述

每当我使用 PHPMailer 自动发送电子邮件时,它都会直接进入 Gmail 中的垃圾邮件文件夹.我曾尝试自己找到解决方案,但我对电子邮件和电子邮件标题的了解不够.

Whenever I send an automated e-mail using PHPMailer, it goes straight into the spam folder in Gmail. I have tried finding a solution to this myself but I don't know enough about e-mails and e-mail headers.

谁能解释为什么会这样?

Can anyone explain why this is happening?

PHP 代码如下,然后是从接收器显示的标题.

PHP Code is below, followed by the headers that show up from the receiver.

谢谢!

$mail = new PHPMailer;
$mail->From = "chrisxenongroup@server.xenonacademy.org.uk";
$mail->FromName = 'Xenon Group Academy';
$mail->AddAddress($email);
$mail->Subject = "Your Xenon Group Academy login details";
$mail->IsHTML(true);
$mail->Body = "<html><body><h3>Welcome to the Xenon Group Academy</h3><p>The Academy is an online system that will allow you to access course materials, manage your assignments and network with other Xenon Group students.</p>
<p>To access your account, go to <a href='http://www.xenonacademy.org.uk'>www.xenonacademy.org.uk</a> and use the following details to login.</p><p><pre>E-mail:            $email</pre></p><p><pre>Password:       " . mysqli_real_escape_string($conn, $_POST['password']) . "</pre></p><br /><br /><p>Once you have logged in, we would recommend changing your password to something secure and easy to remember. You can also change your login e-mail address if you need to.</p><p>Welcome to the Academy, and good luck with your qualification!</p></body></html>";
$mail->Send();



Delivered-To: xxxxxxxxxx@gmail.com
Received: by 10.49.109.71 with SMTP id hq7csp68808qeb;
        Thu, 23 May 2013 07:27:28 -0700 (PDT)
X-Received: by 10.180.37.243 with SMTP id b19mr25275110wik.12.1369319247650;
        Thu, 23 May 2013 07:27:27 -0700 (PDT)
Return-Path: <chrisxenongroup@server.xenonacademy.org.uk>
Received: from server.xenonacademy.org.uk (vps69719724.123-vps.co.uk. [46.32.233.107])
        by mx.google.com with ESMTPS id n5si14506537wic.103.2013.05.23.07.27.26
        for <xxxxxxxxxx@gmail.com>
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Thu, 23 May 2013 07:27:27 -0700 (PDT)
Received-SPF: neutral (google.com: 46.32.233.107 is neither permitted nor denied by best guess record for domain of chrisxenongroup@server.xenonacademy.org.uk) client-ip=46.32.233.107;
Authentication-Results: mx.google.com;
       spf=neutral (google.com: 46.32.233.107 is neither permitted nor denied by best guess record for domain of chrisxenongroup@server.xenonacademy.org.uk) smtp.mail=chrisxenongroup@server.xenonacademy.org.uk
Received: by server.xenonacademy.org.uk (Postfix, from userid 10000)
    id DFBAAE0288; Thu, 23 May 2013 15:27:24 +0100 (BST)
To: xxxxxxxxxx@gmail.com
Subject: Your Xenon Group Academy login details
X-PHP-Originating-Script: 10000:class.phpmailer.php
Date: Thu, 23 May 2013 15:27:24 +0100
From: Xenon Group Academy <chrisxenongroup@server.xenonacademy.org.uk>
Message-ID: <10c74f9a6380f353cb1bdfb4e7c22f52@www.xenonacademy.org.uk>
X-Priority: 3
X-Mailer: PHPMailer 5.2.6 (https://github.com/PHPMailer/PHPMailer/)
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset=iso-8859-1

<html><body><h3>Welcome to the Xenon Group Academy</h3><p>The Academy is an online system that will allow you to access course materials, manage your assignments and network with other Xenon Group students.</p>
<p>To access your account, go to <a href='http://www.xenonacademy.org.uk'>www.xenonacademy.org.uk</a> and use the following details to login.</p><p><pre>E-mail:            xxxxxxxxxx@gmail.com</pre></p><p><pre>Password:     xxxxxxxx</pre></p><br /><br /><p>Once you have logged in, we would recommend changing your password to something secure and easy to remember. You can also change your login e-mail address if you need to.</p><p>Welcome to the Academy, and good luck with your qualification!</p></body></html>

谢谢!

推荐答案

这听起来更像是您的邮件服务器和/或 DNS 服务器的配置问题.您的邮件服务器似乎不够受信任",因此您没有从 GMail(和邮件客户端)获得足够的积极"分数.我注意到您使用 postfix 作为邮件程序...您是否正确配置了它?

This does sound more like a configuration issue with your mail server and/or your DNS server. Your mail server does not appear to be "trusted" enough, so you don't get enough "positive" points from GMail (and mail clients). I notice that you're using postfix as your mailer... Have you configured it properly?

我建议你先配置 postfix.例如,以下是有关如何在 CentOS 中执行此操作的指南:

I would suggest you configure postfix first. For example, here's a guide on how to do it in CentOS:

http://wiki.centos.org/HowTos/postfix

其次,您应该将 SPF 记录添加到您的 DNS 服务器:

Second, you should add an SPF record to your DNS server:

http://en.wikipedia.org/wiki/Sender_Policy_Framework

第三,最好为您的服务器设置一个反向查找条目:

Third, it would be good to have a reverse lookup entry for your server:

http://en.wikipedia.org/wiki/Reverse_DNS_lookup

您需要执行以上操作和其他一些操作,以确保客户不会将您的邮件标记为垃圾邮件,并且您不会被列入黑名单

You will need to do the above and some more to make sure that clients don't flag your mail as spam, and you don't get blacklisted

为了避免被列入黑名单,这里有一个很好的清单:

Here's a good list of things to do to avoid getting blacklisted:

https://www.supportsages.com/prevent-your-mailip-from-getting-marked-as-spamblacklisted-a-few-tips/

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

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