我正在用php提交我的表单,但它将成为垃圾邮件


i am submitting my form with php but it is going to spam

**>下面给出的邮件将成为垃圾邮件。我没有使用

按照我不想的方式担任队长。有人能帮我吗收件箱中的邮件**

 <?php 
        if(isset($_POST['submit']))
        {
            $name = $_POST['Name'];
            $email = $_POST['email'];
            $phone = $_POST['phone'];
            $date = $_POST['checkinDate'];
            $package = $_POST['package'];
            $person = $_POST['adults'];
            $kids = $_POST['kids'];
            $ip=$_SERVER['REMOTE_ADDR']; //trace the ip address of the user submited
            $subject ="Query From  :Kerala-Honeymoon-Packages - Promotion'n"; //subject of the email
            $to="paul@roverholidays.com";
            $cc="online@roverholidays.com";
            $ccc="deepti@roverholidays.com";
            $from=$_POST['email'];
            $adc="Name :$name'n";
            $adc.="Email :$email'n";
            $adc.="Phone :$phone'n";
            $adc.="Date of Travel :$date'n";
            $adc.="Package :$package'n";
            $adc.="Adults :$person'n";
            $adc.="Kids :$kids'n";
            $message ="$name copy of the query you submited in Kerala-Honeymoon-Packages";//message header to user submited
            $headers="From: <".$from. ">" ; 
            mail($cc,$subject,$adc,$headers);
            mail($ccc,$subject,$adc,$headers);
            mail($email,$message,$adc);
            header("Location: thanks.htm");
            }
                else
            {
                return false;
            }
        ?>

编码方面我认为你无能为力,因为是电子邮件服务器将你的电子邮件归类为垃圾邮件,而不是你编码脚本的方式。你所能做的就是从接收者的电子邮件设置中控制它,即你设置你的gmail过滤器,根据"喀拉拉邦蜜月套餐"等关键词检测该电子邮件,并将其从垃圾邮件中删除。

我不确定电子邮件服务器将电子邮件标记为垃圾邮件的算法是什么。然而,我认为从不同的域而不是你的域名发送电子邮件很可能被检测为钓鱼电子邮件。我的意思是,当有人把他/她的雅虎电子邮件放在表单中并点击发送时,你的服务器会把电子邮件发送到脚本中的电子邮件地址,但它会把它当作来自雅虎一样发送,这对接收者的电子邮件服务器来说是可疑的,因为它知道它不是来自雅虎。

许多电子邮件服务会阻止直接从随机服务器发送的邮件,因为它们作为非垃圾邮件的合法来源几乎没有声誉。与其使用直接的phpmail()函数,不如尝试使用像Mandrill或Gmail的SMTP服务这样的SMTP服务。两者都是免费的。

以下是Mandrill的配置页面:http://help.mandrill.com/entries/23737696-How-do-I-send-with-PHPMailer-

<?php
require 'class.phpmailer.php';
$mail = new PHPMailer;
$mail->IsSMTP();                                      // Set mailer to use SMTP
$mail->Host = 'smtp.mandrillapp.com';                 // Specify main and backup server
$mail->Port = 587;                                    // Set the SMTP port
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->Username = 'MANDRILL_USERNAME';                // SMTP username
$mail->Password = 'MANDRILL_APIKEY';                  // SMTP password
$mail->SMTPSecure = 'tls';                            // Enable encryption, 'ssl' also accepted
$mail->From = 'from@example.com';
$mail->FromName = 'Your From name';
$mail->AddAddress('josh@example.net', 'Josh Adams');  // Add a recipient
$mail->AddAddress('ellen@example.com');               // Name is optional
$mail->IsHTML(true);                                  // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body    = 'This is the HTML message body <strong>in bold!</strong>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if(!$mail->Send()) {
   echo 'Message could not be sent.';
   echo 'Mailer Error: ' . $mail->ErrorInfo;
   exit;
}
echo 'Message has been sent';