【发布时间】:2012-03-05 19:10:34
【问题描述】:
大家好,我正在使用联系表单中的 mail(),但由于某种原因它无法正常工作。
我设置的php编码如下:
// sending email to sales@xxx.com
$to = "hello@xxx.com";
$subject = 'Email From {$name} from your website';
$message = "$name has contacted you from the website and says:
$mcontent
$name 's contact email address is: $email";
$headers = $email . "\r\n";
$headers .= "Reply-To: " . $email . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
mail($to, $subject, $message, $headers) or die ("Failure");
// end of sending mail
returnheader("/xxx/email-sent");
我完全没有错误,完成后它甚至会进入成功页面。
任何想法为什么这不起作用。
【问题讨论】:
-
使用退出;在 mail() 下,看看你是否仍然没有错误。
-
@Jleagle 该电子邮件是在联系表单中提交的电子邮件,正如我所说我已经测试过并且没有提交任何错误