PHPmailer 停留在 mail.php 并被标记为垃圾邮件问题
PHPmailer stuck on mail.php AND being marked as spam issue
我有一个问题,PHPmailer 卡在我的 mail.php 屏幕上(通常它会将用户转发到 success.html 页面)。我已经打开错误报告,但仍然没有任何显示。我在 PHP 上是个菜鸟,但在我将它移到实际的 URL 之前,它一直在进行我的测试 URL我的服务器)。现在我卡在白屏上,没有任何错误。
另外,我遇到了一个问题,在 hotmail(也许还有其他一些提供商——Gmail 现在工作正常)上,它会将电子邮件标记为垃圾邮件。我修复了一个反向 DNS 问题,但它仍然将电子邮件标记为垃圾邮件。关于如何解决它的任何想法?请检查我的body,看看内容是否引发任何危险信号。
代码如下:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once('/var/www/includes/PHPMailer/PHPMailerAutoload.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
//gather variables from form//
$gmname = $_POST['gmname'];
$charname = $_POST['charname'];
$email = $_POST['email'];
$date = $_POST['date'];
$time = $_POST['time'];
$bantype = $_POST['radiogroup'];
$banreason = $_POST['banreason'];
//end gather//
$mail = new PHPMailer();
$mail->CharSet = 'UTF-8';
$body ="Attention account holder,<br \>This is a notice informing you that your Ashran account has been suspended. Please review the following information.<br \><br \>Account Name: $email<br \>Character Name: $charname<br \>Server: US - Grommash<br \>Ban Reason: $banreason<br \>Ban Type: $bantype<br \>Ban End Date: $date $time Server Time<br \>Banning staff member: $gmname<br \><br \>If you would like to appeal your ban because you feel that you were incorrectly punished, please follow the instructions in the following thread: <a href="http://forum.ashran.com/index.php?/topic/9461-ban-appeals/#entry68417">Click Here</a><br \><br \>Do NOT reply to this email.";
//$body = eregi_replace("[\]",'',$body);//
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "smtp.gmail.com"; // SMTP server
$mail->SMTPDebug = 1; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "tls"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 587; // set the SMTP port for the GMAIL server
$mail->Username = "----------@gmail.com"; // GMAIL username
$mail->Password = "----------"; // GMAIL password
$mail->SetFrom('----------@gmail.com', '------ -----');
$mail->AddReplyTo("---------@gmail.com","----- -----");
$mail->Subject = "Ashran - Account Suspension Notice";
//$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$address = "$email";
$mail->AddAddress($address);
//Sets URL for forward after completion
$url = 'success.html';
//
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
header( "Location: $url" );
echo "Ban notice sent!!!";
}
?>
对于垃圾邮件文件夹问题:如果您发现自己正在调整内容然后检查它是否解决了传送问题,您可以使用 inboxtrail.com 的基于种子的电子邮件送达率测试,以查看在每次内容更改后哪些电子邮件提供商将您转储到垃圾邮件文件夹。重新测试所有顶级提供商可能是个好主意,因为众所周知,解决 hotmail 问题的内容更改可能会在 gmail 或 yahoo 或其他东西上产生新问题。这还应该告诉您电子邮件服务器的配置方式是否引发了任何危险信号。
我有一个问题,PHPmailer 卡在我的 mail.php 屏幕上(通常它会将用户转发到 success.html 页面)。我已经打开错误报告,但仍然没有任何显示。我在 PHP 上是个菜鸟,但在我将它移到实际的 URL 之前,它一直在进行我的测试 URL我的服务器)。现在我卡在白屏上,没有任何错误。
另外,我遇到了一个问题,在 hotmail(也许还有其他一些提供商——Gmail 现在工作正常)上,它会将电子邮件标记为垃圾邮件。我修复了一个反向 DNS 问题,但它仍然将电子邮件标记为垃圾邮件。关于如何解决它的任何想法?请检查我的body,看看内容是否引发任何危险信号。
代码如下:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once('/var/www/includes/PHPMailer/PHPMailerAutoload.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
//gather variables from form//
$gmname = $_POST['gmname'];
$charname = $_POST['charname'];
$email = $_POST['email'];
$date = $_POST['date'];
$time = $_POST['time'];
$bantype = $_POST['radiogroup'];
$banreason = $_POST['banreason'];
//end gather//
$mail = new PHPMailer();
$mail->CharSet = 'UTF-8';
$body ="Attention account holder,<br \>This is a notice informing you that your Ashran account has been suspended. Please review the following information.<br \><br \>Account Name: $email<br \>Character Name: $charname<br \>Server: US - Grommash<br \>Ban Reason: $banreason<br \>Ban Type: $bantype<br \>Ban End Date: $date $time Server Time<br \>Banning staff member: $gmname<br \><br \>If you would like to appeal your ban because you feel that you were incorrectly punished, please follow the instructions in the following thread: <a href="http://forum.ashran.com/index.php?/topic/9461-ban-appeals/#entry68417">Click Here</a><br \><br \>Do NOT reply to this email.";
//$body = eregi_replace("[\]",'',$body);//
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "smtp.gmail.com"; // SMTP server
$mail->SMTPDebug = 1; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "tls"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 587; // set the SMTP port for the GMAIL server
$mail->Username = "----------@gmail.com"; // GMAIL username
$mail->Password = "----------"; // GMAIL password
$mail->SetFrom('----------@gmail.com', '------ -----');
$mail->AddReplyTo("---------@gmail.com","----- -----");
$mail->Subject = "Ashran - Account Suspension Notice";
//$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$address = "$email";
$mail->AddAddress($address);
//Sets URL for forward after completion
$url = 'success.html';
//
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
header( "Location: $url" );
echo "Ban notice sent!!!";
}
?>
对于垃圾邮件文件夹问题:如果您发现自己正在调整内容然后检查它是否解决了传送问题,您可以使用 inboxtrail.com 的基于种子的电子邮件送达率测试,以查看在每次内容更改后哪些电子邮件提供商将您转储到垃圾邮件文件夹。重新测试所有顶级提供商可能是个好主意,因为众所周知,解决 hotmail 问题的内容更改可能会在 gmail 或 yahoo 或其他东西上产生新问题。这还应该告诉您电子邮件服务器的配置方式是否引发了任何危险信号。