2014-04-12 72 views
0

**>以下給出的郵件將發送垃圾郵件。我沒有使用我使用php提交我的表單,但它會發送垃圾郵件

驗證碼的形式,因爲我不想。因此,任何人可以幫助我的 郵件收件箱**

<?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="[email protected]"; 
      $cc="[email protected]"; 
      $ccc="[email protected]"; 

      $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; 
      } 
     ?> 
+0

這事做與郵件垃圾郵件過濾器。可能會被某些關鍵字觸發,例如包裹,促銷,......垃圾郵件過濾器有很多規則,我只是猜測 – iamsleepy

+0

如果您要發送到自己的郵箱,可以將發件人地址添加爲可信。 – iamsleepy

回答

0

編碼明智的,我不認爲有什麼可以做,因爲它是分類您的電子郵件爲垃圾郵件服務器不您編寫腳本的方式。你所能做的就是從接收郵件設置中控制郵件設置,即設置你的Gmail郵件過濾器,根據「Kerala-Honeymoon-Packages」這樣的關鍵字檢測該郵件並將其移出垃圾郵件。

我不確定電子郵件服務器的算法是用於將電子郵件標記爲垃圾郵件。但是,我認爲從不同域名而不是您的域名發送電子郵件很可能會被檢測爲釣魚郵件。我的意思是,當某人將他/她的雅虎電子郵件發送到表單並點擊發送時,您的服務器將發送電子郵件到腳本中的電子郵件地址,但它會發送它,好像它來自雅虎,這對於收件人電子郵件服務器,因爲它知道它不是來自雅虎。

0

許多電子郵件服務阻止直接從隨機服務器發送的郵件,因爲它們幾乎沒有聲譽作爲非垃圾郵件的合法來源。不要使用直接的php mail()函數,請嘗試使用像Mandrill或Gmail的SMTP服務這樣的SMTP服務。兩者都是免費的。

這裏是山魈配置頁: 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 = '[email protected]'; 
$mail->FromName = 'Your From name'; 
$mail->AddAddress('[email protected]', 'Josh Adams'); // Add a recipient 
$mail->AddAddress('[email protected]');    // 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'; 
相關問題