WEB Formatting the senders name in email form...

Discussion in 'OT Technology' started by brds, Jul 24, 2009.

  1. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,652
    Likes Received:
    15
    Location:
    Atlanta
    When an email is sent via my php script, the sender email shows up as:

    [email protected]

    Is there any way to change this?

    Here's my email script:

    Code:
                $to = $email;
                $subject = "$username, please verify your account";
                $message = "Message goes here";
                $from = "SiteName.com";
                $headers .= 'MIME-Version: 1.0' . "\r\n";
                $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
                $headers .= 'To: ' . $fname . ' <' . $email . '>' . "\r\n";
                $headers .= 'From: SiteName' . "\r\n";
                mail($to,$subject,$message,$headers);
    
    Any ideas?
     
  2. TurkeyChicken

    TurkeyChicken New Member

    Joined:
    Jun 26, 2003
    Messages:
    42,913
    Likes Received:
    0
    Location:
    Albuquerque, NM
    change $headers .= 'From: SiteName' . "\r\n";

    to

    $headers .= 'From: SiteName <[email protected]>'."\r\n";

    that could do it :dunno:

    Also, your $from variable isn't getting used anywhere.
     
  3. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,652
    Likes Received:
    15
    Location:
    Atlanta
    Got it... thanks. :big grin:
     

Share This Page