gpt4 book ai didi

PHP 邮件程序错误

转载 作者:可可西里 更新时间:2023-10-31 22:52:25 26 4
gpt4 key购买 nike

我尝试使用 php mailer 但错误如下。

SMTP -> FROM SERVER:
SMTP -> FROM SERVER:
SMTP -> ERROR: EHLO not accepted from server:
SMTP -> FROM SERVER:
SMTP -> ERROR: HELO not accepted from server:
SMTP -> ERROR: AUTH not accepted from server:
SMTP -> NOTICE: EOF caught while checking if connectedSMTP Error: Could not authenticate. Message could not be sent.

Mailer Error: SMTP Error: Could not authenticate.

和我的代码

 <?php
require("class.phpmailer.php")
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->SMTPAuth = true;

$mail->SMTPDebug = 2;
$mail->Username = "admin@xxxxxxxxxxxx.in";
$mail->Password = "xxxxxxxx";
$mail->From = "admin@xxxxxxxxxxxx.in";
$mail->FromName = "Mailer";
$mail->AddAddress("xxxx@yahoo.co.in", "mine");
$mail->WordWrap = 50;
$mail->IsHTML(true);

$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. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";

?>

最佳答案

由于 SSL 端口错误,我得到了这个。

SSL = 465TLS = 587

参见: http://mail.google.com/support/bin/answer.py?hl=en&answer=13287

关于PHP 邮件程序错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2227702/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com