我遵循XAMPP文档设置sendmail.exe。我加了
sendmail_path = “\”C:\xampp\sendmail\sendmail.exe\” -t”
到php.ini文件,然后
smtp_server=ssl://smtp.gmail.com
smtp_port=465
smtp_ssl=auto
error_logfile=error.log
auth_username=[myemail]@gmail.com
auth_password=[my password]
到sendmail.ini文件。然后,我根据XAMPP文档创建了以下测试
<?php
$to = '[myemail]@gmail.com';
$subject = 'Hello from XAMPP!';
$message = 'This is a test';
$headers = "From: [myemail]@gmail.com\r\n";
if (mail($to, $subject, $message, $headers)) {
echo "SUCCESS";
} else {
echo "ERROR";
}
?>
我收到SUCCESS回声,但是收件箱中什么都没有显示。我想念什么吗?