The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem with FROM in PHP mail function

Discussion in 'E-mail Discussions' started by garak, Nov 22, 2004.

  1. garak

    garak Active Member

    Joined:
    Jan 23, 2004
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Hello, a customer have a strange problem using a php form script.

    In the script headers, he have:

    $headers = "From: $name_rem <$email_rem>\nMime-Version: 1.0 \nContent-Type:
    text/html; charset=iso-8859-1";

    But, when he receives a form message, the FROM field appears in this way: username@machine.name.com when the correct is username@customerdomain.com

    I'm using phpsuexec here....

    Any idea?
     
  2. dezignguy

    dezignguy Well-Known Member

    Joined:
    Sep 26, 2004
    Messages:
    534
    Likes Received:
    0
    Trophy Points:
    16
    You need to add a line for the Return-Path: $email_rem... to do this:

    Look at the php docs, for mail()... I believe it's the 5th variable, is the one for return-path if you're using mail()... if you're using smtp, then you should be able to add "-f $email_rem" as a flag to your call to the mailserver binary.
     
Loading...

Share This Page