我正在尝试发送一封电子邮件,目前工作正常。但是一旦我添加了这一行,它就不会再发送电子邮件了。
$headers = "Content-Type: text/html; charset=ISO-8859-1\r\n";
mail("anton@sci5.com", $subject, $message, $from, $headers )
基本上,当我添加$headers
到我的时mail();
,它不会工作,但如果我删除$header
它,它会发送我的邮件,但不会呈现 html。
我究竟做错了什么?
这是我的代码。
$subject = "E-newsletter Signup";
$message = "$todayis [EST] \n
From: $firstname $lastname ($email)\n
$firstname $lastname has subscribe for the ff. e-newsletters:\n
" ;
if (!empty($ivpump1)) { $message .= "$ivpump1\n"; }
if (!empty($fetal1)) { $message .= "$fetal1\n"; }
if (!empty($biomed1)) { $message .= "$biomed1\n"; }
$message.= "<br /><br /><br />
<p><b>From Webpage :</b> $fromWebpage </p>
<p><b>From Google Keyword :</b> $refKeyword</p>
<p><b>Referring Page :</b> $refPage</p>
<p><b>From IP Address :</b> $endUserIP</p>";
$from = "From: $email\r\n";
$headers = "Content-Type: text/html; charset=ISO-8859-1\r\n";
mail("anton@gmail.com", $subject, $message, $from, $headers );
header("Location: http://www.site.com/thank-you-settings.html");