我有一个联系表单,我正在使用jQuery和PHP编写。下面是PHP位,当我将$ youremail变量更改为我的gmail帐户时,它可以正常工作,但我的办公室Outlook帐户中从未收到过电子邮件。 有什么我想念的吗?
<?php
// Email Vars
$youremail = "my_email@on_outlook2007.com";
$headers = "From: $name <$email>\n";
$subject = "Subject Line Here";
$ip = $_SERVER['REMOTE_ADDR'];
$message_clean = html_entity_decode(stripslashes($message));
// Format Email
$email_format_cc = $message_clean . "\n\n" . "___________________________________________________________________________" . "\n\n" .
"Name: " . $name . "\n" .
"Company: " . $company . "\n" .
"IP Address: " . $ip . "\n" .
"Sent: " . $timestamp;
$email_format = $email_format_cc . "\n" .
"Page: " . $from_url;
mail($youremail, $subject, $email_format, $headers);
?>
答案 0 :(得分:1)
检查服务器的邮件日志,看看/为什么gmail会弹出邮件。 PHP的mail()
函数非常愚蠢,即使宇宙在它周围爆炸,也声称它是成功的。