mail function has FROM changed by server?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Oliver Spiesshofer

    mail function has FROM changed by server?

    Hi,

    I am running a simple mail function, and I want to set the FROM header
    within the function:

    mail(
    "mailbox@provid er.com",
    "testsubjec t",
    "testbody",
    "From: Oliver <oliver@mydomai n.com>
    X-Sender: <oliver@mydomai n.com>
    X-Mailer: Test Script
    Return-Path: <oliver@mydomai n.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 <oliver@provide r.com>

    (!)

    How can I prevent this?

    thanks

    Oliver

  • Manuel Lemos

    #2
    Re: mail function has FROM changed by server?

    Hello,

    On 07/23/2003 10:26 AM, Oliver Spiesshofer wrote:[color=blue]
    > I am running a simple mail function, and I want to set the FROM header
    > within the function:
    >
    > mail(
    > "mailbox@provid er.com",
    > "testsubjec t",
    > "testbody",
    > "From: Oliver <oliver@mydomai n.com>
    > X-Sender: <oliver@mydomai n.com>
    > X-Mailer: Test Script
    > Return-Path: <oliver@mydomai n.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 <oliver@provide r.com>
    >
    > (!)
    >
    > How can I prevent this?[/color]

    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:



    --

    Regards,
    Manuel Lemos

    Free ready to use OOP components written in PHP


    Comment

    Working...