Forum Moderators: coopster
All email sent from php mail() that bounces is being returned to my servers admin email address instead of the "From" or "reply-to" address.
What needs to be put in my header code to ensure that this does not happen?
/* To send HTML mail, you can set the Content-type header. */
$from = "From: Name <info@domain.com>\n";
$from .= "X-Sender: info@domain.com\n";
$from .= "X-Mailer: PHP\n";
$from .= "X-Priority: 3\n";
$from .= "Return-Path: Name <info@domain.om>\n";
$from .= "Reply-To: Name <info@domain.com>\n";
$from .= "Content-type: text/html\n";/* and now mail it */
mail($to, $subject, $message, $from);
I assume it is not like that in the real script just thought I would mention it
I set
Reply-To
Return-Path
From
all to the same address and it works
test it to one of your own accounts and look at the headers on the email and see what's there, it is often the order of the headers that can change things
I'm not much of a PHP person but look at this:
The additional_parameters parameter can be used to pass an additional parameter to the program configured to use when sending mail using the sendmail_path configuration setting. For example, this can be used to set the envelope sender address when using sendmail with the -f sendmail option.