Search code examples
phpemailphpmailer

PHPmailer - sends to one email but not the other


Using PHP sendmail() class. Xampp 3.2.1 on windows local machine. PHP 5.5.15. Using my gmail account to process the emails.

I am able to send to my [email protected] email (my personal email I use regularly), to [email protected] email, but it does not get through to my xxx@hotmail email.

How do I begin troubleshooting why it does not work for the hotmail email? Are there restrictions to some email accounts for this setup?

Basic email code is below:

$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Mailer = 'smtp';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->Host = 'smtp.gmail.com';
$mail->IsHTML(true);
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'XXXXXX';
//Sender Info
$mail->From = 'Test.com';
$mail->FromName = 'Mr. Somebody';
//prepare email body
$mail_body = '<html>
<h2>User Registration Verification from anyCompany</h2>
<p>Thank you for registering</p>
</body>
</html>';
$mail->addAddress('[email protected]','Jack');
$mail->Subject = "Message from anyCompany: Registration";
$mail->Body = $mail_body;
$mail->Send();

Thanks in advance!


Solution

  • Your Email looks like Spam. Did you Check the Spam folder on your Hotmail Account?