Hello,
On 07/23/2003 10:26 AM, Oliver Spiesshofer wrote:
I am running a simple mail function, and I want to set the FROM header
within the function:
mail(
"ma*****@provider.com",
"testsubject",
"testbody",
"From: Oliver <ol****@mydomain.com>
X-Sender: <ol****@mydomain.com>
X-Mailer: Test Script
Return-Path: <ol****@mydomain.com>
Content-Type: text/plain; charset=iso-8859-1"
);
However, form my phpinfo I can see that the from_header is:
FROM_HEADER provider.com
Now, all outgoing emails are changed in the header:
From: Oliver <ol****@provider.com>
(!)
How can I prevent this?
I think you are confusing the From: header with the From header. They
are not the same thing. The former is what you set in your messages and
the later may be set by the MTA to denote the real envelope sender which
is also where bounced messages will eventually return.
To set the envelope sender it depends on the MTA that is used. You may
want to try this class that abstracts the envelope sender address taking
it from the Return-Path: header. See the examples to learn how to do it:
http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/