Page 1 of 1

Mail

Posted: Tue Sep 12, 2006 12:10 pm
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

Posted: Tue Sep 12, 2006 12:30 pm
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");

Posted: Tue Sep 12, 2006 12:55 pm
by moiseszaragoza
Thanks