我有一个PHP脚本从我的网络发送电子邮件到Gmail。
PHP代码
$str = $_POST['to'];
$contacts=explode(",",$str);
foreach($contacts as $contact) {
$to = $contact;
$subject = $_POST['subject'];
$message = $_POST['message'];
$headers = "From: ".$_POST['from']. "
" .
"Reply-To: ".$_POST['reply']."
" .
"X-Mailer: PHP/" . phpversion();
if(mail($to, $subject, $message, $headers)){
echo "
window.alert('Email Sent Successfully')
window.location.href='dashboard.php';
";
}else{
echo "
window.alert('Email Not Sent')
window.location.href='dashboard.php';
";
}
}
}else{
}
}
HTML代码
Your Email | |
Receipant(s) | |
Email for Reply | |
Subject | |
Message | |
Cancel Submit |
邮件正在发送但gmail文本未正确显示。我参考下面的图片,并在此处看到消息标签显示在“”中,这就是为什么它们不起作用。怎么可能让它变得可行。 enter image description here