我有一个使用以下PHP代码发送电子邮件的网络表单:
$senderEmail = "sender@sender.com"
$senderName = "John Smith"
$noreplyEmail = "noreply@receiver.com"
$receiverEmail = "inbox@receiver.com"
$header = "MIME-Version: 1.0\r\nContent-type: text/plain; charset=UTF-8\r\n";
$header .= 'From: "' . $senderName . '" <' . $noreplyEmail . ">\r\n";
$header .= 'Reply-To: "' . $senderName . '" <' . $senderEmail . ">";
$subject = "Contact form";
$message = "...";
mail($receiverEmail, $subject, $message, $header);
问题在于,虽然每次$senderName
,$senderEmail
和$message
在收件人的收件箱(Gmail域收件箱)中有所不同,但电子邮件会堆叠在一起通过Gmail的系统。
什么是防止这种堆叠的正确方法,并将它们作为单独的单独电子邮件接收?