[KLUG Members] Mail from PHP
bill
members@kalamazoolinux.org
Mon, 19 Apr 2004 09:56:58 -0400
Yea, I've had similar problems with all sorts of spam blockers. We have
too many rabid spam blockers and not enough consideration of how we're
bringing e-mail as a whole to a halt because legitimate mail isn't
getting through.
You should be able to set the "From" header, as well as others, from
within PHP but some ISPs still block the e-mail. Sometimes you have to
add a "From" and a "Reply-to" and they have to match. But, in your
case, it doesn't seem like even the "From" header is working. So first,
have you checked that $yada_yada is in quotes so the "from" header isn't
appearing in the body of the email?
Because you're doing it from PHP, we'll assume you're not root.
Easiest fix is to look at the sendmail setting in PHP.ini.
Alternatively, if you're using virtual hosts, you can have a default
"from" by adding this directive in the config file (in httpd.conf,
within each virtual host directive):
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f
fromname@someserver.com"
Additionally
If you don't like the X-authentication-warning header from using the -f
flag, you can remove authwarnings from sendmail's PrivacyOptions.
sendmail.mc: define(`confPRIVACY_FLAGS', `authwarnings,...')dnl
sendmail.cf: O PrivacyOptions=authwarnings,...
Alternatively, from within you're PHP code, I've heard this can help:
mail($to, $subject, $body, $from, "-f $from_email_address");
Lastly for now, some ISPs ignore the From and Reply-to headings and want
to run reverse DNS on the first "Received: from" line header, e.g.,
Received: from server1.billtronservices.com
So, setting reverse DNS on the name of your box can help.
kind regards,
bill
Robert G. Brown wrote:
>>>I'm using the php mail() function to send stuff to someone at charter.net,
>>>like this...
>>>
>>>mail(someone@charter.net,"Response from the website",$yada_yada,
>>> "From: thewebsite@thewebsotedomain.com");
>>>
>>>charter.net rejects it because it's from "apache@localhost.localdomain"
>>>
>>>How can that be changed?
>>>
>>> Regards,
>>> ---> RGB <---