简体   繁体   English

PHP中的联系表不接收hotmail的邮件

[英]Contact form in php doesnt receive mail for hotmail

I m trying contact form in php.I receive the mails in gmail,yahoo etc but doesnt recieve any mails in hotmail.I tried a lot but doesnt know whats the problem.Why i cant recieve mail in hotmail? 我正在尝试使用php中的联系表。我收到了gmail,yahoo等邮件,但在hotmail中未收到任何邮件。我尝试了很多但不知道出了什么问题。 Here is the code. 这是代码。

if (empty($error)) {

     $to = 'abc@gmail.com, ' . $email;
    $subject = " contact form message";
     $repEmail = 'abc@gmail.com';
       $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);

    }
    }
    ?>

Check the server admin's email for bounce messages. 检查服务器管理员的电子邮件中是否存在退回邮件。 I would guess it has to do with hotmail rejecting it either because it doesn't like your host or because you don't have SPF or DKIM signing set up. 我想这与hotmail拒绝它有关,要么是因为它不喜欢您的主机,要么是因为您没有设置SPF或DKIM签名。 Either way, the blame is probably on your server email administrator more than on your code. 无论哪种方式,都应该将责任归咎于服务器电子邮件管理员,而不是代码。 Email is actually kinda complex to set up nowadays given all the anti-spam stuff you have to do. 考虑到您必须做的所有反垃圾邮件工作,如今电子邮件实际上有点复杂。

You might want to consider using a third party email service. 您可能要考虑使用第三方电子邮件服务。 SMTP through a gmail account or Amazon SES so they'll take care of more of these details. 通过gmail帐户或Amazon SES进行SMTP,因此它们将处理更多这些详细信息。 This can be set up by the server admin too, or done in PHP with libraries. 这也可以由服务器管理员设置,也可以在PHP中使用库来完成。 Is there a SMTP mail transfer library in PHP PHP中是否有SMTP邮件传输库

this is more likely 这更有可能

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("anything@something.com", $subject,
  $message, "From:" . $email);
  echo 'Thank you ! we will contact you soon';
}

  }

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

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