2014-11-22 30 views
0

我嘗試在php.I中的聯繫表格,我收到的郵件在Gmail,雅虎等,但不接收任何郵件hotmail.I試了很多,但不知道最新的問題。爲什麼我不能在hotmail中收到郵件?這是代碼。在php中的聯繫表格不接收hotmail的郵件

if (empty($error)) { 

    $to = '[email protected], ' . $email; 
    $subject = " contact form message"; 
    $repEmail = '[email protected]'; 
     $headers = 'From: Contact Detail <'.$repEmail.'>'.$eol; 
    $content = "Contact Details: \n 
Name:$name \n 
Batch: $batch \n 
Email: $email \n 
mobile: $mobile " ; 
$success = "<b>Thank you! Your message has been sent!</b>"; 
    mail($to,$subject,$content,$headers); 

    } 
    } 
    ?> 
+0

你檢查垃圾? – Jonast92 2014-11-22 03:50:52

+0

雅檢查..但沒有郵件太 – user3675208 2014-11-22 03:51:47

+0

你最好引用這個問題http://stackoverflow.com/questions/13324649/mail-not-being-received-by-hotmail-com – Rashid 2014-11-22 05:17:10

回答

0

檢查服務器管理員的電子郵件是否存在退回郵件。我想這是因爲它不喜歡你的主機,或者你沒有設置SPF或DKIM簽名,所以它與Hotmail拒絕它有關。無論哪種方式,責備可能在您的服務器電子郵件管理員上,而不是您的代碼上。鑑於所有需要做的反垃圾郵件,現在設置電子郵件實際上有點複雜。

您可能需要考慮使用第三方電子郵件服務。 SMTP通過gmail帳戶或亞馬遜SES,以便他們能夠處理更多這些細節。這也可以由服務器管理員設置,或者使用庫來完成。 Is there a SMTP mail transfer library in PHP

0

這種可能性更大

if (isset($_REQUEST['email'])) 
//if "email" is filled out, send email 
    { 
    //send email 
    $email = $_REQUEST['email'] ; 
    $subject = 'Order' ; 
    $message = 
    'Product Name :'. $_REQUEST['proname']."\n". //these all are example details 
    'Name :'.$_REQUEST['name']."\n". 
    'Phone :'. $_REQUEST['phone']."\n". 
    'City :'.$_REQUEST['city']."\n". 
    'Address :'.$_REQUEST['address']."\n". 
    'Quantity :'. $_REQUEST['select']; 

if ($email == "" || $subject == "" || $message == "" ) 
    { 
    echo 'Please fill the empty fields'; 
    } 
else{ 
    mail("[email protected]something.com", $subject, 
    $message, "From:" . $email); 
    echo 'Thank you ! we will contact you soon'; 
} 

    }