Thanks for the response!
Would you happen to have an example on setting these headers in a php form processor?
Thanks for the response!
Would you happen to have an example on setting these headers in a php form processor?
If you want to send e-mails using PHP mail() function and change the from e-mail address then you may create a php.ini file in a directory where you are sending e-mails from and set the below variable in it:
youre-mail@domain.com will need to be replaced with your address.Code:sendmail_path="/usr/sbin/sendmail -t -i -f your-mail@domain.com"
Last edited by Matt; 10-13-2010 at 09:34 PM.
We were talking about this earlier, Lynne, and got me curious. I've noticed "On behalf of arjuna.harmonmediagroup.com" appearing in my client's sendmail generated messages. I saw that this was an Exim config thing. Is this to help get messages to the recipients without ending up in a spam box. Such as mail.hosteddomain.com coming from the sendmail on the server?
Would / should you change this behavior?
Charles
Charles H
http://www.harmonmediagroup.com
The option you are referring to is from WHM > Exim Configuration:
Set the Sender: Header when the mail sender changes the sender (-f flag passed to sendmail)
My interpretation of the description of this setting, checking it off in your WHM will set the -f header for you when using the PHP mail() function so that it does not need to be set in php.ini. I do not think that it actually works though.Always set the "Sender:" header when the sender differs from the actual sender. Unchecking this will stop "On behalf of" data in Microsoft® Outlook, but may limit your ability to track abuse of the mail system.
You can try enabling it in your WHM if it is not set already then retry your form processor and let us know how it goes.
Send your friends and site visitors to GlowHost and get $125 plus bonus!
GlowHost Affiliate Program | Read our Blog | Follow us on X |
This is a great topic - I've seen so many ways to form headers for sendmail, but I've had good luck with the following:
By your email above, I'll have to do some research to see if I need to add a "Sender:" header as well as the "From:". Maybe this has all changed since I last looked into it, but it is a good discussion.PHP Code:if (strtoupper(substr(PHP_OS,0,3)=='WIN')) {
$eol="\r\n";
} elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')) {
$eol="\r";
} else {
$eol="\n";
}
$headers .= 'From: Mr. Person<person@domain.com>'.$eol;
$headers .= 'Reply-To: Mr. Person<person@domain.com>'.$eol;
$headers .= 'Return-Path: Mr. Person<person@domain.com>'.$eol; // these two to set reply address
$headers .= "Message-ID: <userid@".$_SERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol; // These two to help avoid spam-filters
Lynne is always a good discussion starter![]()
Charles H
http://www.harmonmediagroup.com
I agreeCharles, if you use [php] tags instead of [code] tags in your posts, the php will be easier to read. Do you want me to edit your post for you?
Send your friends and site visitors to GlowHost and get $125 plus bonus!
GlowHost Affiliate Program | Read our Blog | Follow us on X |
Nah, should have done that in the first place. I'll post back with a "well-formed" header as well, working out the details now.
Thanks,
Charles H
http://www.harmonmediagroup.com