我有一个非常简单的电子邮件脚本,我将其与表单结合使用。
<?php
$fName = $_POST;
$access = array_values($fName);
$emailString =" Name: ".$access[0]." ".$access[1]."\n
Organization: ".$access[2]."\n
Email: ".$access[3]."\n
Number: ".$access[4]."\n
What They Wrote: ".$access[5]."\n";
$to = "clients@email.com, my@email.com";
$messageSubject = "Somebody has contacted you from ClientsWebSite";
$messageBody = wordwrap($emailString, 55, "\n");
$headers = "From: noreply@clientswebsite.com\r\n" ."X-Mailer: php";
if(mail($to, $messageSubject, $messageBody, $headers)){
echo("<script> var mailSent = true </script>");
}else{
echo("<script> var mailSent = false </script>");
}
?>
上面的代码是为了一个非常快速和肮脏的&#34;发送评论&#34;形式。问题是,正如您所看到的,我已将电子邮件发送给我和客户的电子邮件地址。我有gmail,我完整地收到了这封信,就像这样:
noreply@clientswebsite.com 11:23 AM(5分钟前)
给客户,我
Name: One MoreTime Organization: WeGottaDancin Email: OoohYeah@wegottheDancin.com Number: 0123456789 What They Wrote: ONE MORE TIME
但是当他收到电子邮件时,&#34;他们所写的内容&#34;电子邮件的部分不存在。我已经做了一些搜索,并且无法找到可行的解决方案。
有人有想法吗?