我最近搬到了一个专用服务器。我更改了我域上的名称服务器,新网站现在运行良好。但是,新注册的确认电子邮件成员应该收到的自动电子邮件等似乎没有发送。为什么会这样?
我知道可能有各种各样的潜在原因,但如果有人有任何建议,听到它们会很棒!我使用 Squirrel Mail 检查了几个电子邮件帐户,在新的专用服务器上发送和接收似乎都很好。
在此先感谢您的任何建议!:-)
停止 phpmail()
被视为垃圾邮件
您必须添加针头:
示例代码:
$headers = "From: myplace@example.com\r\n";
$headers .= "Reply-To: myplace2@example.com\r\n";
$headers .= "Return-Path: myplace@example.com\r\n";
$headers .= "CC: sombodyelse@example.com\r\n";
$headers .= "BCC: hidden@example.com\r\n";
if ( mail($to,$subject,$message,$headers) ) {
echo "The email has been sent!";
} else {
echo "The email has failed!";
}
?>