note 25627 deleted from ref.mail by vincent
| From: | vincent@php.net | Date: | Fri, 12 Sep 2003 06:48:43 +0000 |
| Subject: | note 25627 deleted from ref.mail by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56325@lists.php.net to get a copy of this message | ||
Note Submitter: pvlasenko@hotmail.com
----
I had trouble sending emails with mail()function some peple would get the emails then other would
not, I had partialy solved this problem (see my post above) with avoiding mail function. It solved
the problem but still for example hotmail would only get 3/10 sometimes 0/10 messages, I have now
compleately solved this problem by adding ALL REQIRED headers and changing the sendmail path with
envelope matching address ......
ini_set(sendmail_path, "/usr/sbin/sendmail -t -f webmaster@domain.com");
//Contents of an Registration Auto responce email(text format)
$message = "Thanks for registering".$userName;
$headers .= "From: Name<webmaster@domain.com>\n";
$headers .= "Reply-To: <webmaster@domain.com>\n";
$headers .= "X-Sender: <webmaster@domain.com>\n";
$headers .= "X-Mailer: PHP4\n"; //mailer
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
$headers .= "Return-Path: <webmaster@domain.com>\n";
mail($email,"Registration COnfirmation",wordwrap(stripslashes($message)),$headers);
//Uncomment this to send html format
//$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
//$headers .= "cc: birthdayarchive@php.net\n"; // CC to
//$headers .= "bcc: mail@server.com"; // BCCs to, separete multiple with commas
mail@mail.com, mail2@mail.com