Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-04-2012, 10:09 PM   PM User | #1
The Noob Coder
New Coder

 
Join Date: Jul 2012
Posts: 72
Thanks: 1
Thanked 0 Times in 0 Posts
The Noob Coder is an unknown quantity at this point
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.
The Noob Coder is offline   Reply With Quote
Old 10-04-2012, 10:38 PM   PM User | #2
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,513
Thanks: 45
Thanked 439 Times in 428 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
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.
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Old 10-05-2012, 08:23 PM   PM User | #3
The Noob Coder
New Coder

 
Join Date: Jul 2012
Posts: 72
Thanks: 1
Thanked 0 Times in 0 Posts
The Noob Coder is an unknown quantity at this point
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 .
The Noob Coder is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:50 PM.


Advertisement
Log in to turn off these ads.