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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    553
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting Name and No Domain on From header

    If I set up my email as below, I can supply a from email address. Which is great. But I would like to use just a name, instead of an email address. From: gorilla, instead of from: gorilla@codingforums.com. When I try just using the name, it seems the mail server sticks a domain on. Is there a way to do this so only name appears?


    $headers = "From: ".$email_from;

    mail($to, $subject, $body, $headers);

  • #2
    New Coder
    Join Date
    Feb 2003
    Location
    Brazil
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I do it like that:

    $name = "put your name here"
    $headers = "From: $name <$email_from>";

    mail($to, $subject, $body, $headers);


  •  

    Posting Permissions

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