每当我的邮件发送到phpmailer的垃圾邮件 [英] Everytime my mail goes to spam in phpmailer

查看:98
本文介绍了每当我的邮件发送到phpmailer的垃圾邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是发送邮件的代码:

    $fullname = $_POST['fullname'];
    $email = $_POST['email'];
    $telephone = $_POST['telephone'];
    $email = $_POST['email'];
    $date = $_POST['date'];
    $time = $_POST['time'];
    $adult = $_POST['adult'];
    $children = $_POST['children'];
    $company_name = $_POST['company_name'];
    $addition = $_POST['addition'];
    $confirm = $_POST['confirm'];

    $body = '
    <table width="100%" border="0" cellpadding="0">
      <tr>
        <td>Dear Sir,
        </td>
      </tr>
      <tr>
        <td><b>Booking request from '.$fullname .'</b><br /><br />
          <u>The details provided are:</u><br />
          <p>Name : '.$fullname.'<br />
          E-mail Address: '.$email.'<br />
          Telephone: '.$telephone.'<br />
          Date: '.$date.'<br />
          Time: '.$time.'<br />
          Adult: '.$adult.'<br />
          Children: '.$children.'<br />
          Company Name: '.$company_name.'<br />
           Confirm by: '.$confirm .'<br />
         Additional Requirements: '.$addition.'<br />
          </p>
           </td>
      </tr>
      <tr>
        <td>
        <p>Thank you,<br />
        Kaavya Cuisine
        </p></td>
      </tr>
    </table>
    ';

    $to         = 'sujal@longtail.info';
    $subject    = 'Booking Request';
    $sitename='Website Name';

    $mail = new PHPMailer(); 
    $mail->AddReplyTo($to,$sitename);
    $mail->SetFrom($email,$fullname);


    $mail->AddAddress($to, $sitename);
    $mail->Subject    = $subject;

    $mail->MsgHTML($body);
    $mail->Send();

每次发送邮件时,都会发送垃圾邮件。有人知道为什么会发生这种情况吗?

Every time I send the mail, it goes in to spam. Does anyone know why this is happening?

推荐答案

根据您的代码,我注意到您直接从您的网页发送电子邮件在您的域上。

Based on you code i notice that you are sending an email directly from you web page on your domain.

例如,您使用@ hotmail.com地址。

For example you used an @hotmail.com address.

当收件人收到邮件邮件服务的收件人时,我测试了邮件发件人的反向DNS。所以发件人来自@ hotmail.com,但邮件来自您的域名当然不是hotmail.com。

When the recipient receive the emails the mail service of the recipient my test a reverse DNS of the sender of the mail. So the sender is from @hotmail.com but the mail comes from your domain which of course is not hotmail.com.

所以我从地址@hotmail收到邮件.com但ip发件人根本不与域名hotmail.com相关:这是垃圾邮件!

So i receive a mail from an address @hotmail.com but the ip sender isn't related at all with domain hotmail.com: that's spam!

http://en.wikipedia.org/ wiki / Reverse_DNS_lookup

我认为一个可能的解决方案是:在你的php代码中使用autenticate与smpt并从那里发送邮件!

I think a possibile solution is: in you php code use autenticate with smpt and send from there the mail!

这篇关于每当我的邮件发送到phpmailer的垃圾邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆