我有一個腳本來發送給客戶一封電子郵件。我們剛剛注意到,這些電子郵件只會被髮送到通常會結束的電子郵件地址,例如:@ gmail.com,@ yahoo.com,@ Hotmail.com等。每當我們遇到類似** @ platinumpets的自定義電子郵件地址.com或* @ landsberg.com永遠不會收到電子郵件地址。我可以確認服務器正在發送電子郵件,用戶只是從來沒有收到它。我們已經檢查了所有垃圾郵件文件夾並完成了各種谷歌搜索,但我還沒有發現類似於我們的任何問題。有任何想法嗎?下面是代碼:PHP電子郵件不會發送到自定義電子郵件地址
<?PHP
$subject = "Alert";
$mailheader.= "From: " . "Smartphone Pet Tag Team <[email protected]>\n";
$mailheader.= "X-Sender: " . "[email protected]\n";
$mailheader.= "Return-Path: " . "[email protected]\n";
$mailheader .= "Bcc: [email protected]";
$body .= "Dear " . $ownername . ", \n\n";
$body .= "" . $petname . "'s Smartphone Pet Tag has just been scanned.\n\n";
$body .= "Click here to Login :\n";
$body .= "http://www.smartphonepettag.com\n";
$body .= "********************\n\n";
// $body .= "Scan detected at " . $
//$body .= "Your pets id tag was scanned at the following date and time: " . $datetime; . ", \n";
// $body .= "To stop receive automated alerts click here: \n";
// $body .= 'http://www.smartphonepettag.com/id/alert.php';
// $body .= "and provide your username and password to remove these alerts.
$body .= "Regards,";
$body .= " \n\n";
$body .= "Smartphone Pet Tag Team";
$body .= " \n\n";
$body .= "Keeping Pets Safe and Found";
mail($email_to, $subject, $body, $mailheader) or die ("Mail could not be sent.");
//end email alert
}
//$id=$_GET["id"];;
if (!$id) {
echo 'You have not entered an ID number. Please go back and try again.';
exit;
}
if ($id=="id=app") {
header("Location: http://www.smartphonepettag.com/id/app.php");
exit;
}
header("Location: http://www.smartphonepettag.com/id/profile.php?id=$id");
?>
完成任何基本的調試,比如檢查mail()的返回值和/或你的郵件服務器的日誌,以查看PHP(如果?)php關閉電子郵件後會發生什麼? –
他說他確認服務器正在發送郵件。我的猜測是它被垃圾郵件過濾器阻止。 – Barmar
我很抱歉,爲什麼人們會投我的問題? – DolbyOver