我正在尝试为我的作业/练习目的开发一个基本的PHP邮件应用程序。这就是为什么我要在本地开发环境(XAMPP)上工作的原因。
我的php.ini代码:
[mail function]
SMTP=mail.example.com
smtp_port=587
sendmail_from = [email protected]
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
我的sendmail.ini代码
[sendmail]
smtp_server=mail.example.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
[email protected]
auth_password=*********
[email protected]
我用于发送电子邮件的PHP代码:
$to = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = array(
'From' => '[email protected]',
'Reply-To' => '[email protected]',
'X-Mailer' => 'PHP/' . phpversion()
);
mail($to, $subject, $message, $headers);
从本地主机发送邮件时发生以下错误。
sendmail: Error during delivery: Reply Code is not valid: ecur
还有其他人遇到此问题吗?
可能的解决方案是什么?
足够去sendemai.ini并更改它
smtp_ssl=none
并开始工作