简体   繁体   English

PHP联系表标记为垃圾邮件

[英]PHP Contact Form marked as Spam

I could really use your help on this one. 我真的可以在这方面使用您的帮助。 I've written the following email form and it works with my own private domain email address (me@my-domain.co.uk), however, the corporate email address (me@work.com) must have a stronger spam filter as there not going through. 我已经写了以下电子邮件表格,它可以与我自己的私有域电子邮件地址(me@my-domain.co.uk)一起使用,但是公司电子邮件地址(me@work.com)必须具有更强大的垃圾邮件过滤器,因为那里没有经过。 I'm now looking to decrease the spam level by organising seperate MIME types, ie text/html and text/plain varying on the client side. 我现在正在寻求通过组织单独的MIME类型(例如,客户端上的text / html和text / plain)来降低垃圾邮件级别。 I've looked at the following tutorial: http://www.tek-tips.com/faqs.cfm?fid=2681 我看了以下教程: http : //www.tek-tips.com/faqs.cfm? fid= 2681

The problem is that it makes no sense. 问题在于这没有任何意义。 Can anyone point me in the right direction to rectify the problem and inform me how to sort the seperate headers etc? 谁能指出我正确的方向来纠正问题,并告诉我如何对单独的标题进行排序?

<?php
  {
  $to = "me@work.com, me@my-domain.co.uk";
  $subject = "Quotation Request from Work Website.";
  $headers = "Content-type:text/html;charset=iso-8859-1";
  $first_name = filter_input(INPUT_POST, 'first_name');
  $last_name = filter_input(INPUT_POST, 'last_name');
  $telephone = filter_input(INPUT_POST, 'telephone');
  $gotNumberFrom = filter_input(INPUT_POST, 'gotNumberFrom');
  $quoteFor = filter_input(INPUT_POST, 'quoteFor');
  $address = filter_input(INPUT_POST, 'address');
  $takenBy = filter_input(INPUT_POST, 'takenBy');

  $message = 
  "<span style='font-weight: bold;'>Name: </span>"."<br />".$first_name." ".$last_name."<br />"."<br />".
  "<span style='font-weight: bold;'>Telephone: </span>"."<br />".$telephone."<br />"."<br />".
  "<span style='font-weight: bold;'>Address of Works: </span>"."<br />".$address."<br />"."<br />".
  "<span style='font-weight: bold;'>Quotation for: </span>"."<br />".$quoteFor."<br />"."<br />".
  "<span style='font-weight: bold;'>Got our number from: </span>"."<br />".$gotNumberFrom."<br />"."<br />".
  "<span style='font-weight: bold;'>Quotation taken by: </span>"."<br />".$takenBy."<br />"; 

  mail($to, $subject,"<html>Hola!<br /> Please find details below of the individual that has requested a quotation Gaffer.<br />
      <br />" . $message . "</html>", $headers);
  echo "Your message has been successfully sent, here's a lollipop. <br />"?>
<?php  }
?>

Any help would be extremely appreciated! 任何帮助将不胜感激!

The main reason behind the issue is improper headers, pass proper headers into your mail function and you'll be good to go. 该问题背后的主要原因是标题不正确,将适当的标题传递到您的邮件函数中,您将一路顺风。 You can use the following example: 您可以使用以下示例:

$headers  = "From: My site<noreply@example.com>\r\n";
$headers .= "Reply-To: info@example.com\r\n";
$headers .= "Return-Path: info@example.com\r\n";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM