I’ve configured several headers in the mail() function, sender name and other fields appear as set. But, in the gmail mailed-by field, I see the hostname of my server, even though I’ve set the Mailed-By header to be different… Is there a way to change this, or am I specifying the wrong header to effect the change?
Current Headers:
From: no-reply@example.com Mailed-By: Example.com X-Mailer: Example/1.0
If you post the headers you are sending it will be easier to diagnose the issue. But the header should be "X-Mailer" to set the application mailed-by field, as far as I know. If that does not work, post your current headers and we can help you further / better.
EDIT:
Doing some further research, it seems the 5th parameter with the "-f" flag would be the way to do it:
mail($to, $message, $body, $headers, '-fnoreply@yourmailer.com');Is a possibility. That is generally an email address, so you would have to see what values it accepts etc. I found this information from the Joyent Discussion Board.
But reading that it may not be what you want.
From the sendmail Man page. I will see if I cannot strum anything else up.