Mail

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

Post Reply
User avatar
moiseszaragoza
Forum Commoner
Posts: 87
Joined: Sun Oct 03, 2004 4:04 pm
Location: Ft lauderdale
Contact:

Mail

Post by moiseszaragoza »

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
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

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");
User avatar
moiseszaragoza
Forum Commoner
Posts: 87
Joined: Sun Oct 03, 2004 4:04 pm
Location: Ft lauderdale
Contact:

Post by moiseszaragoza »

Thanks
Post Reply