section31 Posted October 9, 2005 Share Posted October 9, 2005 (edited) 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 October 9, 2005 by section31 Quote Link to comment Share on other sites More sharing options...
section31 Posted November 14, 2005 Author Share Posted November 14, 2005 (edited) 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 November 14, 2005 by section31 Quote Link to comment Share on other sites More sharing options...
Deverill Posted November 14, 2005 Share Posted November 14, 2005 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.