我的主机正在使用 SquirrelMail,从 Squirrel 面板我可以发送邮件,此外我也可以接收邮件。拿了简单的代码来测试:
$to = 'test@gmail.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
if(mail($to, $subject, $message, $headers)){
echo '1';
}else echo '2';
phpinfo()
SMTP localhost
smtp_port 25
sendmail_from no value | no value
sendmail_path /usr/sbin/sendmail -t -i -f **MAIL** | /usr/sbin/sendmail -t -i
where **MAIL** is my personal mail, not the one, I want to send from
但是使用我的脚本我无法发送电子邮件。收到 2. wtf ?