我对 php 邮件生成器有疑问。我不明白我的代码将 $visitor_email 放入消息中......你能帮帮我吗?
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');