[英]PHP Contact Form marked as Spam
我真的可以在這方面使用您的幫助。 我已經寫了以下電子郵件表格,它可以與我自己的私有域電子郵件地址(me@my-domain.co.uk)一起使用,但是公司電子郵件地址(me@work.com)必須具有更強大的垃圾郵件過濾器,因為那里沒有經過。 我現在正在尋求通過組織單獨的MIME類型(例如,客戶端上的text / html和text / plain)來降低垃圾郵件級別。 我看了以下教程: http : //www.tek-tips.com/faqs.cfm? fid= 2681
問題在於這沒有任何意義。 誰能指出我正確的方向來糾正問題,並告訴我如何對單獨的標題進行排序?
<?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 }
?>
任何幫助將不勝感激!
該問題背后的主要原因是標題不正確,將適當的標題傳遞到您的郵件函數中,您將一路順風。 您可以使用以下示例:
$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.