dongmeirang4679 2014-06-20 20:54
浏览 39

梨发送邮件不起作用

I'm writing a script to send some mail. When running the script I get a success message, and show the email being sent from my Gmail account but am not receiving the email in my hotmail account. I've checked all the possible locations (spam, junk, etc.) I am using a Bitnami Stack on EC2. Apache error log shows no errors.

<?php 
// Pear Mail Library
 require_once "Mail.php";

$from = '<myaddress@gmail.com>'; //one of my addresses
$to = '<myaddress@live.com>'; // another address of mine at hotmail
$subject = 'Hi!';
 $body = "Hi,

How are you?";

$headers = array(
'From' => $from,
'To' => $to,
'Subject' => $subject
);

$smtp = Mail::factory('smtp', array(
    'host' => 'ssl://smtp.gmail.com',
    'port' => '465',
    'auth' => true,
    'username' => 'myusername@gmail.com',
    'password' => 'mypas',
    'debug' => true
));

 $mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
echo('<p>' . $mail->getMessage() . '</p>');
} else {
echo('<p>Message successfully sent!</p>');
}

?>

The screen prints out `message sent successfully' and it also shows the debug information. Not quite sure what I'm looking for in the debug info, but I don't believe there are any errors. Here it is in case it's helpful in solving this.

DEBUG: Recv: 220 mx.google.com ESMTP 72sm4616111qgt.1 - gsmtp DEBUG: Send: EHLO localhost DEBUG: Recv: 250-mx.google.com at your service, [54.84.241.113] DEBUG: Recv: 250-SIZE 35882577 DEBUG: Recv: 250-8BITMIME DEBUG: Recv: 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 PLAIN-CLIENTTOKEN DEBUG: Recv: 250-ENHANCEDSTATUSCODES DEBUG: Recv: 250 CHUNKING DEBUG: Send: AUTH LOGIN DEBUG: Recv: 334 VXNlcm5hbWU6 DEBUG: Send: ZmFpcmNoaWxkd2Vic29sdXRpb25zQGdtYWlsLmNvbQ== DEBUG: Recv: 334 UGFzc3dvcmQ6 DEBUG: Send: WW9kYTEyM3lvZGE= DEBUG: Recv: 235 2.7.0 Accepted DEBUG: Send: MAIL FROM: DEBUG: Recv: 250 2.1.0 OK 72sm4616111qgt.1 - gsmtp DEBUG: Send: RCPT TO: DEBUG: Recv: 250 2.1.5 OK 72sm4616111qgt.1 - gsmtp DEBUG: Send: DATA DEBUG: Recv: 354 Go ahead 72sm4616111qgt.1 - gsmtp DEBUG: Send: From: To: Subject: Hi! Hi, How are you? DEBUG: Send: . DEBUG: Recv: 250 2.0.0 OK 1403297270 72sm4616111qgt.1 - gsmtp DEBUG: Send: QUIT DEBUG: Recv: 221 2.0.0 closing connection 72sm4616111qgt.1 - gsmtp

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信会员卡等级和折扣规则
    • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
    • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
    • ¥15 gdf格式的脑电数据如何处理matlab
    • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
    • ¥100 监控抖音用户作品更新可以微信公众号提醒
    • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
    • ¥70 2048小游戏毕设项目
    • ¥20 mysql架构,按照姓名分表
    • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分