下面是我从 Linux 服务器发送的预订表格电子邮件的代码:
$body = "
<p>Hello sir,</p>
<p>Name: <b> {$firstname}</b><br />
Email: <b> {$email}</b><br />
Phone: <b> {$phone}</b><br />
Length Of Stay: <b> {$length} </b><br />
Number in Party: <b> {$party} </b><br />
Month : <b> {$month} </b><br />
Day: <b> {$day} </b><br />
Year: <b> {$year} </b><br />
Additional information:<b> {$additional_information} </b>
</p>
<p>with best regards, <br /><b>My Website</b></p>
";
$to = 'info@currentwebsite.com';
$subject = 'Message';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: '. $email. "\r\n";
$headers .= 'Reply-To: '.$email.'' . "\r\n" ;
if(mail($to, $subject, $body, $headers))
{
phpalert( 'Your request has been sent successfully!' );
}
else {
phpalert( 'Sorry! could not send your request. Please try again later.' );
}
有谁知道我的邮件为什么不来?显示“您的请求已成功发送!” 但我在收件箱甚至垃圾邮件中都找不到任何电子邮件。
补充 有没有机会阻止来自服务器的邮件?