【发布时间】:2014-06-13 13:00:08
【问题描述】:
最近我在使用PHP Mailer 功能发送电子邮件时遇到问题。我从脚本发送的每封邮件都会直接进入 GMail、HotMail 和其他邮件提供商的垃圾邮件文件夹。
我已经用我的域名、密码等配置了所有东西……
这是我的 PHP 代码:
$message = "
<html>
<head>
<title>Activation</title>
</head>
<body>
<p>Hello moorthi , </p>
<p>Thank you for Using My Mail Service <b><a href='http://www.mobilebeez.co.in/'>mobileBeez </a></b></p><br/>
<p><b>mobileBeez Technologies<b><br>Chennai, India.</p>
<p><a href='https://www.facebook.com/mobileBeez'>https://www.facebook.com/mobileBeez</a></p>
</body>
</html>
";
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->Host = "vps.vendarcorporates.com";
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
$mail->Port = 465;
$mail->IsHTML(true);
$mail->Username = "info@vendarcorporates.com";
$mail->Password = "***************";
$mail->SetFrom("info@vendarcorporates.com");
$mail->FromName = "mobile Beez";
$mail->AddReplyTo("info@vendarcorporates.com","mobile Beez");
$mail->Subject = "Activate your Account";
$mail->Body = $message;
$mail->AddAddress("moorthi@gmail.com"); // To Address
if($mail->Send()) {
print json_encode("SUCCESS");
}
else {
echo "Mailer Error: " . $mail->ErrorInfo;
}
我得到了类似SUCCESS 的结果,意思是“邮件已成功发送”。但是当我查看我的 GMail 时,我发送的邮件在垃圾邮件文件夹中。
在我的服务器上这是邮件配置
Secure SSL/TLS Settings (Recommended)
Username: info@vendarcorporates.com
Password: Use the email account’s password.
Incoming Server: vps.vendarcorporates.com
IMAP Port: 993
POP3 Port: 995
Outgoing Server: vps.vendarcorporates.com
SMTP Port: 465
Authentication is required for IMAP, POP3, and SMTP.
【问题讨论】:
-
您的电子邮件被作为垃圾邮件拦截 - 除了减少“垃圾邮件”之外,没有其他“解决方案”。这不是配置或编码问题 - 这是内容或域问题。
-
所以显然你说的代码和配置没有错误。我认为我的内容也没有问题,我的域只有你说的问题,对吗?
-
这取决于您发送的电子邮件的内容和域(或者可能是数量) - 或者其他人是否将其标记为垃圾邮件......很多事情。
-
在我的服务器“roundcube”webmail 中配置。,使用这个我手动发送邮件(不是从我的脚本)像往常一样在 gmail 撰写邮件。,该邮件也只进入垃圾邮件文件夹。,
-
这个问题似乎是题外话,因为它是关于诊断电子邮件传递问题,而不是关于编程。