我正在尝试通过XAMPP配置Sendmail以发送电子邮件。在我的sendmail.ini中,我具有以下设置:
# Set default values for all following accounts.
logfile "C:\xampp\sendmail\sendmail.log
account Gmail
tls on
port 587
tls_certcheck off
host smtp.gmail.com
from myemail@gmail.com
auth on
user myemail06@gmail.com
password mypassword
account default : Gmail
我创建了这样的测试脚本:
$to = "testemail@btinternet.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$headers = "From: myemail06@gmail.com" . "\r\n";
if (mail($to, $subject, $body, $headers)) {
echo ("Message successfully sent!");
} else {
echo ("Message delivery failed...");
}
我收到一条消息,说该电子邮件已发送但从未收到,在日志中,我得到:
sendmail:传递过程中出错:必须首先发出STARTTLS命令。
有人知道问题可能在这里吗?
提前致谢!
加兹
阿晨1998