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