尽管将php.ini配置为有效的send_from地址,但出现此错误。我知道这是有效的,因为它从松鼠邮件发送它时,但在用PHP发送邮件时,它将无法正常工作。该无效地址可能是指send_from地址。所以我不明白它是如何认为它是错的。这里是PHP代码:mail():SMTP服务器响应:550 hmailserver上的地址不是有效错误
$email="[email protected]";
$subject = "Your New Password";
$from="[email protected]";
$message = "Your new password is as follows:
xxxxxxxxxxxxxxxxxxxxxxxxxxx
This email was automatically generated.";
if(!mail($email, $subject,$message,$from)){
echo ("error");
}else echo "success";
,并在php.ini:
SMTP = localhost
sendmail_from = [email protected]
您是否尝试将sendmail_from更改为实际有效的电子邮件地址? – rationalboss
dayshare.local是否有dns + mx记录? – BugFinder
我用[email protected]通过非php方法发送了电子邮件,所以推测这不是问题 – user1557515