Jump to content
section31

Hotmail Unable To Recieve Email Using Pear Mail

Recommended Posts

Ok, I was trying to break the habit of using the mail() function and instead start using pear's mail library so I can authenticate myself and I won't have to send as "nobody".

 

Well, I wrote a sample script and had it send 3 emails, one for each of the largest free email providers. One to gmail, yahoo, and hotmail. All of them go through fine except hotmail. It doesn't throw it in the junk mail, it just doesn't get delivered. I've tried this on 2 servers, one on tch and also on another host. Same results...Any Ideas? If someone wants to try it out, that would be great.

 

Here is the snippet of code to get you going.

 

http://section31.us/scripts/test/smtp/hotmail.wth.phps

><?
error_reporting(E_ALL);
include('Mail.php');

$headers['From'] = 'name <user@yourdomain.tld>';  // put your name and email here
$headers['Subject'] = 'Testing SMTP Mail';

$body = 'This is a plain text body message.';

$params['auth'] = true;
$params['host'] = 'localhost';
$params['username'] = 'user@yourdomain.tld';  // put your username here which is your email address
$params['password'] = 'pass'; // pur your pass here
$params["persist"] = true;

$mail_object =& Mail::factory('smtp', $params);

foreach (array('user@hotmail.com', 'user@yahoo.com', 'user@gmail.com') as $to) {  // put your emails here
$headers['To'] = $to;
$mail_object->send($to, $headers, $body);
echo "Email sent to $to!<br />";
}
?>

Edited by section31

Share this post


Link to post
Share on other sites

Hm, now I can't seem to send any type of email to hotmail without it being filtered as spam.

 

I've tried doing a very basic email using mail(), then I tried using php mail classes like PHP Mailer and Richard Heyes Mail Class.

 

All emails are being put in the junk email. Any ideas? Has anyone had success with this?

Edited by section31

Share this post


Link to post
Share on other sites

If it were me I'd either wait a day and see if Hotmail is doing something squirrely or send the email content to the helpdesk to see if they know of any issues regarding email.

 

Are you sure the content doesn't look like junk? Some filters will call email junk if there's no subject line or if it contains certain words.

 

Hope you can get it worked out soon.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...