PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
moiseszaragoza
Forum Commoner
Posts: 87 Joined: Sun Oct 03, 2004 4:04 pm
Location: Ft lauderdale
Contact:
Post
by moiseszaragoza » Tue Sep 12, 2006 12:10 pm
When ever I use the mail function in PHP i get the e-mails from
Code: Select all
mail($sendTo, $subject, $message);
but it apears that it is send from
Code: Select all
moiseszaragoza@ linhostjava18.prod.mesa1.secureserver.net
how can i set the sender
jayshields
DevNet Resident
Posts: 1912 Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England
Post
by jayshields » Tue Sep 12, 2006 12:30 pm
You can change the default in your php.ini or you can use the header parameter in mail() to set the from address.
Code: Select all
mail($sendTo, $subject, $message, "From: My Name <myname@mydomain.com>\r\n");