不发送包含我的域名链接的电子邮件

时间:2015-02-14 08:10:11

标签: php email ssl hosting

我无法从包含我网站 https://www.gogglegator.com 链接的任何主机发送电子邮件。没有这个链接,电子邮件工作正常,电子邮件中的所有其他链接都正常工作。

当我尝试使用phpmailer时,出现错误邮件程序错误:SMTP错误:数据未被接受。

有没有人遇到过这样的问题并且有可能的故障排除步骤?我从三天开始搜索但没有成功。

提前感谢您的时间。

<?php 
require_once('class.phpmailer.php');
include("class.smtp.php");

//Create a new PHPMailer instance
$mail = new PHPMailer();

//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 0;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
//Set the hostname of the mail server
$mail->Host = "smtp.mail.yahoo.com";
//Set the SMTP port number - likely to be 25, 465 or 587
$mail->Port = 465;
//Username to use for SMTP authentication
$mail->Username = "myaddress@yahoo.com";

//Password to use for SMTP authentication
$mail->Password = "mypass";
//Set who the message is to be sent from
$mail->setFrom('myaddress@yahoo.com', 'Test');
//Set an alternative reply-to address
$mail->addReplyTo('myaddress@yahoo.com', 'Test');
//Set who the message is to be sent to
$mail->addAddress('myaddress@yahoo.com');
//Set the subject line
$mail->Subject = "Test";
$mail->MsgHTML("https://www.gogglegator.com/");



if (!$mail->send()) {
     $message = "Mailer Error: " . $mail->ErrorInfo;
} else {
    $message = "Thank you for contacting us.";
}
echo $message; ?>

0 个答案:

没有答案