note 46486 deleted from function.mail by aidan
| From: | aidan@php.net | Date: | Mon, 14 Feb 2005 02:22:12 +0000 |
| Subject: | note 46486 deleted from function.mail by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-84968@lists.php.net to get a copy of this message | ||
Note Submitter: tbellefy at yahoo dot com
----
Hello all,
I have a simple solution to some of the larger email companies(Y!, Hotmail etc..) rejecting your
emails sent from a php script:
First thing I did was identify the default "Return-Path:" header which in my case was
www@mydomain.com. This is obviusly set by my hosting company and I had no control over it. Every
email I sent from this address was being automatically added to the bulk folder.
I tried using the -f switch but still ended up in the bulk folder because it would generate a
X-Authentication-Warning header.
I had to edit /etc/mail/submit.cf on my server and add www as a trusted user.
Here are the lines to look for in your submit.cf file:
#####################
# Trusted users #
#####################
# this is equivalent to setting class "t"
#Ft/etc/mail/trusted-users
Troot
Tdaemon
Tuucp
Tmailnull
Twww <-- notice the addition of the www user.
Now I can use the -f switch freely and all emails are getting accepted in the inbox!
Snippet:
<?php
mail($to, $subject, $message, $headers, "-f".$return_path."");
?>
Good Luck!