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 Coder The Noob Coder's Avatar
    Join Date
    Jul 2012
    Location
    The City that Never Sleeps
    Posts
    99
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Can I change the name of the sender for a PHP generated email?

    Is it possible to change the name of the sender for a PHP generated email?
    PHP Code:
    mail($recipient$subject$message
    My company's website is hosted with GoDaddy (not my choice, it was done long before I began working for them). The sender associated with a PHP email (i.e., the server) has this cryptic looking name with a mix of random numbers and letters. I guess this is the server's name. This server is owned by GoDaddy, if I'm not mistaken, and I guess I can't change the name through them. I'm also afraid that if the server's name is changed, then it would break the site, since it runs on Wordpress.

    So is there a way to just change the name of the sender for a PHP email? Could I possibly make it go through some other email address? The reason I need to do this is that the current email address is too cryptic and people might think it is spam or something, because the company's name isn't in it.

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,310
    Thanks
    58
    Thanked 525 Times in 512 Posts
    Blog Entries
    5
    Yes. Look at http://www.php.net/mail

    You'll notice it has a 4th and 5th parameter that you can use to set the from address.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #3
    New Coder The Noob Coder's Avatar
    Join Date
    Jul 2012
    Location
    The City that Never Sleeps
    Posts
    99
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tangoforce View Post
    Yes. Look at http://www.php.net/mail

    You'll notice it has a 4th and 5th parameter that you can use to set the from address.
    Thanks. I never knew there were more parameters to the mail function. I'll give it a shot. Otherwise I'll be back .


  •  

    Posting Permissions

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