Forum Moderators: coopster
Return-Path: <apache@mydomain.com>
Here is the header setup in our mail() script. Domains and email addresses have been altered:
$headers = "From: Name <'mail@mail.com'>\n";
$headers .= "Reply-To: Name <'mail@mail.com'>\n";
$headers .= "Return-Path: Name <'mail@mail.com'>\n";
$headers .= "Message-ID: <".$now."TheSystem@".$_SERVER['SERVER_NAME'].">\n";
$headers .= "X-Mailer: PHP v".phpversion()";
Is it possibly a setting in php.ini that is restricting the mail function headers to be changed? Thanks!
mail($to, $subject, $message, $headers, '-fmyname@example.com');
Note that there is no whitespace between the -f flag and the email address.
An alternative would be to set the flag more permanently in php.ini:
sendmail_path = "/usr/sbin/sendmail -t -i -f myname@example.com"
Does anyone have any insight or recommendations for using the mail() function with a form that emails other members on a site?
Example: Our email inquiry form allows a person to input his/her email address, a short question and then the system, using the mail() function sends the email to the recipients email address we have on file.
Do email providers like yahoo or hotmail look at these messages as spammy since mydomain.com/IP sent the email and it contains a different return too: email address, etc.?
Some things that may help are no HTML in the mail, valid PTR in DNS, an SPF record, a name in the To: header, and of course no mentioning of private parts, casino's, stocks, credit, and so on.