梨邮件被发送到hotmail的垃圾文件夹

时间:2013-04-14 22:18:15

标签: php email pear hotmail

即时尝试使用postfix和PEAR Mail从我的VPS发送电子邮件到hotmail帐户,它完美地发送给yahoo,gmail,但是hotmail直接进入垃圾邮件,我知道之前已经问过问题,我知道尝试了一切,

我的主机名是libreriaplenitud.mx

这是我的PHP脚本

 include('Mail.php');
 include('Mail/mime.php');

    // Constructing the email
    $sender = "Jorge <jorgegc21@libreriaplenitud.mx>";                              // Your name and email address
    $recipient = "El Yorch <jorgegc_21@hotmail.com>";                           // The Recipients name and email address
    $subject = "Test Email";                                            // Subject for the email
    $text = 'This is a text message.';                                  // Text version of the email
    $html = '<html><body><p>This is a html message</p></body></html>';  // HTML version of the email
    $crlf = "\n";
    $headers = array(
                    'From'          => $sender,
                    'Return-Path'   => $sender,
                    'Subject'       => $subject
                    );

    // Creating the Mime message
    $mime = new Mail_mime($crlf);

    // Setting the body of the email
    $mime->setTXTBody($text);
    $mime->setHTMLBody($html);

    $body = $mime->get();
    $headers = $mime->headers($headers);

    // Sending the email
    $mail =& Mail::factory('mail');
    if($mail->send($recipient, $headers, $body)){
        echo 'email sent succesfully';
    }

以下是hotmail正在接收的标题

Authentication-Results: hotmail.com; spf=none (sender IP is 192.34.60.167) 
smtp.mailfrom=www-data@libreriaplenitud.mx; dkim=none header.d=libreriaplenitud.mx; 
x-hmca=none
X-SID-PRA: jorgegc21@libreriaplenitud.mx
X-AUTH-Result: NONE
X-SID-Result: NONE
X-Message-Status: n:n
X-Message-Delivery: Vj0xLjE7dXM9MDtsPTA7YT0wO0Q9MjtHRD0yO1NDTD02
X-Message-Info:  
11chDOWqoTkNi4xaXoUxBJHNxb4q3jMdTE9occzTaBqAAmPh8MI+3AvSCyxtKvnRXgUwZQ9hB9zRIQG0MbHnJc1TejqWYpS9Vk7aOR7/8zlZcfOTkN+DLYQYashlrK5kkvMohRBt73VDj9hh9fgOPZb7AfegtTPz
Received: from libreriaplenitud.mx ([192.34.60.167]) by COL0-MC1-F2.Col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4900);
 Sun, 14 Apr 2013 14:51:31 -0700
Received: by libreriaplenitud.mx (Postfix, from userid 33)
id 2498040A95; Sun, 14 Apr 2013 21:51:31 +0000 (UTC)
To: El Yorch <jorgegc_21@hotmail.com>
Subject: Test Email
X-PHP-Originating-Script: 0:mail.php
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="=_4404fe2999b34dc58f10c890ae3d5e76"
From: Jorge <jorgegc21@libreriaplenitud.mx>
Message-Id: <20130414215131.2498040A95@libreriaplenitud.mx>
Date: Sun, 14 Apr 2013 21:51:31 +0000 (UTC)
Return-Path: www-data@libreriaplenitud.mx
X-OriginalArrivalTime: 14 Apr 2013 21:51:32.0085 (UTC) FILETIME=[39DB8250:01CE395A]

--=_4404fe2999b34dc58f10c890ae3d5e76
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=ISO-8859-1

This is a text message.
--=_4404fe2999b34dc58f10c890ae3d5e76
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=ISO-8859-1

<html><body><p>This is a html message</p></body></html>
--=_4404fe2999b34dc58f10c890ae3d5e76--

我认为我没有被列入黑名单,我只是设置了这个vps

任何想法可能出错?

提前致谢

1 个答案:

答案 0 :(得分:1)

这不是电子邮件库,而是你的MX域,主要是因为你遗漏了一些东西。 您必须设置DomainKeys / DKIM和SPF才能使您的电子邮件合法。 而且,即使你设置了这些,不要指望进入收件箱,这将是50/50的机会。电子邮件现在是一场真正的噩梦。

您现在进入收件箱的唯一原因是因为您的IP地址干净且没有垃圾邮件,但不要指望这会持续下去,您迟早会被列入黑名单。

只是一个提示,你可以使用类似http://mandrill.com/的smth(他们有一个很好的api)来发送电子邮件,它可以免费发送少量电子邮件,并且可以让你快速前进,大多数重要的是你每次都会到达收件箱,而且你不必经历一个叫做电子邮件设置的噩梦。