Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question mail() header from: Always Changed to Server's Address

    Hi,

    I have a simple mail function like this:
    PHP Code:
    $headers 'From: '.$myName.' <'.$myMail.'>'."\r\n".
    'Reply-To: '.$myMail."\r\n".
    'Return-Path: '.$myMail."\r\n".
    'X-Mailer: PHP/'.phpversion();
    mail($sendTo$subject$message$headers); 
    The problem is, when the email arrived at one's inbox... the "From: "
    header is always changed to <user>@ns123.hostname.com.

    That was when I used my host's email accounts or of my other hosts.
    But when I put some free addresses from services like GMail/Yahoo,
    it went through without hassle (name and address remains unchanged).

    Anybody can tell me what actually is going on, and maybe
    the proper setup for the hosting's email accounts, so this
    can just work properly?

    Thank you in advance,

    t_kio

  • #2
    New Coder
    Join Date
    Sep 2007
    Location
    Hanoi, Vietnam
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your PHP code has no errors. This problem may caused by your mail server configuration (postfix, sendmail, mdaemon or exchange...). If you are server administrator, look for "ns123.hostname.com". You will get mail configuration file to edit. Otherwise, contact your server administrator.

  • #3
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    @Nothinglastz
    First, thanks for the reply.
    But I'm afraid that isn't the case, because if it IS... then when I put
    Yahoo/GMail address as the FROM: header, it would also be altered, right?

    Well, it's not. If I put something like username@gmail.com, the FROM:
    header would successfully be sent, nothing altered.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •