如何解决-[发送邮件:传递过程中出现错误:回复代码无效:ecur]?

问题描述 投票:1回答:1

我正在尝试为我的作业/练习目的开发一个基本的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 

还有其他人遇到此问题吗?

可能的解决方案是什么?

php email smtp phpmailer sendmail
1个回答
0
投票

足够去sendemai.ini并更改它

smtp_ssl=none

并开始工作

© www.soinside.com 2019 - 2024. All rights reserved.