我有这样的PHPMailer:https://github.com/PHPMailer/PHPMailer/的PHPMailer不会发送邮件
我的代码是这样的:
$mail = new PHPMailer;
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'kms-play.it'; // Specify main and backup server
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '[email protected]'; // SMTP username
$mail->Password = 'pass'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
$mail->From = '[email protected]';
$mail->FromName = 'KMS-Play';
$mail->addAddress('[email protected]', 'Lars Mehrhoff'); // Add a recipient
#$mail->WordWrap = 50; // Set word wrap to 50 characters
#$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
#$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
#$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}
echo 'Message has been sent';
和错误是:
2013-12-15 15:02:23 CLIENT -> SERVER: EHLO local.kms-play.it 2013-12-15 15:02:23 CLIENT -> SERVER: STARTTLS 2013-12-15 15:02:23 SMTP ERROR: STARTTLS command failed: 502 5.5.1 Error: command not implemented 2013-12-15 15:02:23 CLIENT -> SERVER: QUIT SMTP connect() failed. Message could not be sent.Mailer Error: SMTP connect() failed.
你肯定'公里,play.it'支持TLS连接? – Ohgodwhy
通过问题标题,我通过PHPMailer宣布关闭服务。 – silentboy
没有TLS它说:'2013-12-15 15:10:33客户端 - >服务器:EHLO local.kms-play.it 2013-12-15 15:10:33客户端 - >服务器:AUTH LOGIN 2013-12 -15 15:10:33 SMTP ERROR:AUTH命令失败:535 5.7.8错误:身份验证失败:身份验证机制无效2013-12-15 15:10:33 CLIENT - > SERVER:QUIT SMTP connect()失败。邮件无法发送。邮件错误:SMTP连接()失败。' – Evolutio