我嘗試使用郵件功能來發送郵件,但它總是在垃圾郵件文件夾發送,並通過@ gator4120.hostgator.com如何使用郵件功能
<?php
$subject = "Registration completed !!!! ";
$from= "From: [email protected]\n";
$message ="Dear ".$varfname.",\n";
$message = $message."\r\nCongratulations! \n";
$message = $message."You are now a member of B2B Portal.\n";
$message = $message."Your profile is under screening and will be activated within next 24 hrs.\n ";
$header .= "Reply-To: admin <$from>\r\n";
$header .= "Return-Path: admin <$from>\r\n";
$header .= "From: admin <$from>\r\n";
$header .= "Organization: The organization\r\n";
$header .= "Content-Type: text/plain\r\n";
if (mail("[email protected]", $subject, $message, $header)) {
echo "The email has been sent!";
} else {
echo "The email has failed!";
}
?>
如果TI去垃圾郵件的,因爲電子郵件服務器決定它是一個垃圾郵件,除了使用更可靠的域名,以及減少可疑消息並警告客戶可能發生的情況之外,您無法將其作爲發件人做太多工作。這不是你可以決定的,也不是客戶的一方。對於第二部分,您需要提供更多數據,但請注意,您根本不會將您的變量傳遞給郵件,也不會將其格式錯誤。 – mikus
有沒有什麼方法可以修復它 – Bhavesh