PHP邮件生成器-错误的消息结构
我有一个php邮件生成器问题。我不明白我的代码在邮件中放入$visitor\u电子邮件。。。你能帮我吗PHP邮件生成器-错误的消息结构,php,function,email,mail-sender,Php,Function,Email,Mail Sender,我有一个php邮件生成器问题。我不明白我的代码在邮件中放入$visitor\u电子邮件。。。你能帮我吗 id = $_POST['ID']; $tt = $_POST['TT']; $visitor_email = $_POST['email']; $message = $_POST['message']; //Validate first if(empty($id)||empty($tt)||empty($visitor_email)) { echo "ID, TT and ema
id = $_POST['ID'];
$tt = $_POST['TT'];
$visitor_email = $_POST['email'];
$message = $_POST['message'];
//Validate first
if(empty($id)||empty($tt)||empty($visitor_email))
{
echo "ID, TT and email are required!";
exit;
}
if(IsInjected($visitor_email))
{
echo "Wrong email!";
exit;
}
$email_from = 'xxx@mymail.com';//<== update the email address
$email_subject = "Something in title";
$email_body = "$message".
$to = "$visitor_email";//<== update the email address
$headers = "From: $email_from \r\n";
//Send the email!
mail($to, $email_subject, $email_body, $headers);
//done. redirect to thank-you page.
header('Location: end-page.html');
id=$\u POST['id'];
$tt=$_POST['tt'];
$visitor\u email=$\u POST['email'];
$message=$_POST['message'];
//先验证
if(空($id)| |空($tt)| |空($visitor| u email))
{
echo“需要ID、TT和电子邮件!”;
出口
}
如果(已输入($visitor_电子邮件))
{
回音“错误的电子邮件!”;
出口
}
$email\u发件人:xxx@mymail.com';// 将$message后面的替换为强>
将连接变量
$email_body = $message;
只需删除引号:$to=$visitor\u email代码>