我的邮件发送代码:
$mail = new PHPMailer(true);
$mail->IsSMTP();
try {
$mail->Host = 192.168.205.19;
$mail->Port = 25;
$mail->SMTPDebug = 2;
$mail->SMTPSecure = "tls";
$mail->SMTPAuth = true;
$mail->Username = "mymailadress@mysite.com";
$mail->Password = "mypassword";
$mail->From = "mymailaddress@mysite.com";
$mail->FromName = "My Mail Address";
$mail->SetFrom("mymailaddress@mysite.cm", "My Mail Address");
$mail->AddAddress('toaddress@mysite.com');
$mail->Subject = "Test for subject";
$mail->MsgHTML("Test my mail body");
if ($mail->Send()) {
$result = 1;
} else {
$result = "Error: " . $mail->ErrorInfo;
}
} catch (phpmailerException $e) {
$result = $e->errorMessage();
} catch (Exception $e) {
$result = $e->getMessage();
}
return $result;
结果?
SMTP -> FROM SERVER:220 evo.callpex.int Microsoft ESMTP MAIL Service ready at Tue, 27 Nov 2012 17:45:24 +0200
SMTP -> ERROR: Password not accepted from server: 535 5.7.3 Authentication unsuccessful
我正在使用 PHPMailer 类发送邮件。和 SMTP。我正在连接到 Exchange 邮件服务器。但我有这个错误。
为什么?
谢谢!