我正在尝试在成功注册后向用户发送电子邮件。以下是我的.php代码。
$to = $email;
$subject = "Signup | Verification";
$message = "Congratulation $f_name $l_name you have been successfully registered. Please
click the link to active your account.\r\n";
$message .= "http://www.maaks.fr/hotel/verify.php?email=$email&hash=$hash\r\n";
$from = "noreply@yoursite.com";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-rype: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding; 7bit\r\n";
$headers = "From:" . $from . "\r\n";
$sentmail = mail($to,$subject,$message,$headers);
if($sentmail)
{
header("Location: thankyou.php?member=successfully");
exit();
}
它没有向用户发送电子邮件。我查了一下,如果 $ sentmail 没问题,那就去 thankyou 页面了。但有趣的是,如果没有发送电子邮件,它会转到 thankyou 页面。
有什么我忘记的吗?