PHP脚本
require '../PHPMailerAutoload.php';
//Create a new PHPMailer instance
//Passing true to the constructor enables the use of exceptions for error handling
$mail = new PHPMailer(true);
try {
$mail->Port = 25;
$mail->Timeout = 10;
$mail->isSMTP();
$mail->SMTPDebug = 3;
$mail->CharSet = 'UTF-8';
$mail->Host = 'mail1.ClientWeb.com';
$mail->SMTPAuth = true;
$mail->Username = 'test_mail@ClientWeb.com';
$mail->Password = 'pwd';
$mail->setFrom('from@example.com', 'First Last');
$mail->addReplyTo('replyto@example.com', 'First Last');
$mail->addAddress('keprta.martin@gmail.com', 'Martin Keprta');
$mail->Subject = 'test';
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
$mail->AltBody = 'This is a plain-text message body';
$mail->addAttachment('images/phpmailer_mini.png');
$mail->send();
echo "Message sent!";
} catch (phpmailerException $e) {
echo $e->errorMessage();
} catch (Exception $e) {
echo $e->getMessage();
}
问题描述
客户端在他的服务器上有一个显然运行的脚本。我试图连接到他的服务器,这是可能的,但当我尝试发送电子邮件后出现错误
2017-05-07 18:31:57 Connection: opening to mail1.warmacher.com:25, timeout=10, options=array ( )
2017-05-07 18:31:57 Connection: opened
2017-05-07 18:32:07 SERVER -> CLIENT:
2017-05-07 18:32:07 CLIENT -> SERVER: EHLO localhost
2017-05-07 18:32:17 SERVER -> CLIENT:
2017-05-07 18:32:17 SMTP ERROR: EHLO command failed:
2017-05-07 18:32:17 CLIENT -> SERVER: HELO localhost
我可以理解连接已经建立,但出于某种原因,电子邮件不会发送。
我在问这个光荣的社区之前采取的步骤
答案 0 :(得分:0)