Sp 我正在尝试发送一封电子邮件,代码运行良好,直到我从标准电子邮件切换到 html 电子邮件。
它住在这里: http: //kenthomes.net/Amelia-Cove
单击“共享此计划”。
我的代码是:
$person = $_POST["name"];
//Where will you be pulling emails from?
$emailDB = "emailAddresses";
$type = $_POST["type"];
//Get Share URL that is misformatted.
$waybefore = $_GET["share"];
$before = str_replace("*", "?", $waybefore);
$shareMe = str_replace("!", "=", $before);
$id = $_SERVER['HTTP_REFERER'];
$id = $_SERVER['HTTP_REFERER'];
//Where do you want a copy of this email to go to? (or null)
$copyDB = "";
if($_GET["com"])
{
$prettyType = "Community";
}
else if($_GET["inv"])
{
$prettyType = "Move-In Ready Home";
}
else if($_GET["mod"])
{
$prettyType = "Model Home";
}
$_POST["date"] = date("Y-m-d");
$Emails = new Controller($emailDB, null, null, true);
$ed = $Emails->getData();
//
// The good stuff
//
$emailTo = $_POST["email"];
$subject = "Kent Homes - " . $person . " would like to share a " . ucwords(strtolower($_GET['type'])) . " with you!";
$out = '<html><body>';
$out .= $person . " thought you would like this " . $prettyType . " by Kent Homes. Click the link to view: http://kenthomes.net" . $shareMe . "</br></br>";
$out .= "Additional Message from " . $person . "</br>";
$out .= $_POST['msg'];
$out .= '</body></html>';
$headers = "From: " . $person "<noreply@kenthomes.com>\r\n";
$headers .= "Reply-To: <noreply@kenthomes.com\r\n";
$headers .= "X-Mailer: PHP/" . phpversion()."\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
//
// Send 'er off!
//
mail($emailTo, $subject, $out, $headers);
if($toEmail) {
mail($emailTo, $subject, $out, $headers);
}
echo "<p>This " . ucwords(strtolower($_GET['type'])) . " has been sent to " . $_POST["email"] . ".</p>";
unset($_POST["id"]);
我收到错误:
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
这是 html 邮件内容之前功能代码的样子:
$Captcha = new MCaptcha();
if($_POST["submitit"])
{
$answer = $Captcha->checkAnswer();
if($answer)
{
$person = $_POST["name"];
$emailTo = $_POST["email"];
$subject = "Kent Homes - " . $person . " would like to share a " . ucwords(strtolower($_GET['type'])) . " with you!";
//Where will you be pulling emails from?
$emailDB = "emailAddresses";
$type = $_POST["type"];
//Get Share URL that is misformatted.
$waybefore = $_GET["share"];
$before = str_replace("*", "?", $waybefore);
$shareMe = str_replace("!", "=", $before);
$id = $_SERVER['HTTP_REFERER'];
$id = $_SERVER['HTTP_REFERER'];
//Where do you want a copy of this email to go to? (or null)
$copyDB = "";
if($_GET["com"])
{
$prettyType = "Community";
}
else if($_GET["inv"])
{
$prettyType = "Move-In Ready Home";
}
else if($_GET["mod"])
{
$prettyType = "Model Home";
}
$out = $person . " thought you would like this " . $prettyType . " by Kent Homes. Click the link to view: http://kenthomes.net" . $shareMe . " ";
$_POST["date"] = date("Y-m-d");
$Emails = new Controller($emailDB, null, null, true);
$ed = $Emails->getData();
mail($emailTo, $subject, $out, $headers);
if($toEmail) {
mail($emailTo, $subject, $out, $headers);
}
echo "<p>This " . ucwords(strtolower($_GET['type'])) . " has been sent to " . $_POST["email"] . ".</p>";
unset($_POST["id"]);
}
}