通过我的网站,联系表单或其他来源发送的任何电子邮件都会发送到我的Gmail帐户中的垃圾邮件文件夹中。我目前正在获取使用pop3发送的电子邮件。
我点击"非垃圾邮件"按钮每次,但它没有任何帮助。此外,我只是尝试设置一个过滤器来帮助解决这个问题,但问题仍然存在。
电子邮件总是来自不同的发件人,但它始终来自我的主机,即:gatorxxxxx@hostgator.com。这是我在过滤器中输入的电子邮件地址。我把它包含在' From'并且'有“'选项。
这需要时间吗或我应该尝试什么?
$name = trim(htmlspecialchars($_POST['contact_name'], ENT_QUOTES));
$email = trim(htmlspecialchars($_POST['contact_email']));
$phone = trim(htmlspecialchars($_POST['contact_phone']));
$message = trim(htmlspecialchars($_POST['contact_message'], ENT_QUOTES));
$email_from = "contact@xxx.com";
if($hasError !== true) {
$to = "contact@xxx.com";
$subject = "Contact Form Submitted";
$msgcontents = "Name: $name<br>Email: $email<br>Phone Number: $phone<br>Message: $message";
$headers = "MIME-Version: 1.0 \r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1 \r\n";
$headers .= "From: $name <$email_from> \r\n";
$emailsent = mail($to, $subject, $msgcontents, $headers);
答案 0 :(得分:1)
那是因为您的联系表格正在发送给您自己,客户会在地址中发送电子邮件。您需要以不同的方式向自己发送电子邮件,其中客户的电子邮件地址不在“发件人”字段中。
您可以在此处详细了解:The contact us form delimma