每当我使用 PHPMailer 发送一封自动电子邮件时,它都会直接进入 Gmail 的垃圾邮件文件夹。我自己尝试过找到解决方案,但我对电子邮件和电子邮件标头知之甚少。
谁能解释为什么会这样?
下面是 PHP 代码,后面是接收器显示的标头。
谢谢!
$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>
谢谢!