note 39918 added to ref.mail

From: Date: Sun, 15 Feb 2004 19:01:08 +0000
Subject: note 39918 added to ref.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-65177@lists.php.net to get a copy of this message
I was unable to send email to Hotmail for a long time, I scoured php.net, codewalkers.com, phphelp.com just to name a few to find some answers. I submitted code for help, and the only thing I heard was maybe Hotmail had black-listed my IP or domain name. I don't know if this is true, but I wrote to them to find out, haven't heard anything back yet. I wrote to my host, the same day and told him I wrote Hotmail (they had been working on trying to resolve this issue for a week). I then found some code (I don't remember where) that may have helped. One of these three things allowed me to send email to Hotmail. I understand Hotmail really doesn't like php mail(), but this code works. Just so you know, I am cut-and-pasting this code (with the exception of changing the website name) so there are no errors in retyping below. I hope this helps someone.... function notify_password($email, $password) { $to = $email; $subject = "Your Web-Site.com Password"; $msg = "Here is your new password. Please be sure to change it when you log in next.\n"; $msg .= $password; $headers = "From: \"Belgian-Primeurs\" <support@web-site.com>\r\n"; $headers .= "Reply-To: support@web-site.com\r\n"; $headers .= "Organization: www.web-site.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "Content-Transfer-encoding: 8bit\r\n"; $headers .= "X-Priority: 1\r\n"; $headers .= "X-MSMail-Priority: High\r\n"; $headers .= "X-Mailer: PHP/" . phpversion()."\r\n"; $headers .= "X-Sender: support@web-site.com\r\n"; $headers .= "Return-Path: support@web-site.com\r\n"; if (mail($to, $subject, $msg, $headers)) return true; else return false; ---- Manual Page -- http://www.php.net/manual/en/ref.mail.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39918 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39918&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39918&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#65177) next »