Page 1 of 1

Help !! I don't know why this error when I use mail function

Posted: Thu Dec 01, 2005 10:30 am
by jvizuete
Hi !! When I try send a mail using mail function, the next message appears:

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing

And yes, I put From address, but ....

Please, can someone help me?

Re: Help !! I don't know why this error when I use mail func

Posted: Thu Dec 01, 2005 11:17 am
by foobar
jvizuete wrote: Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing
Open up your php.ini and search for sendmail_from. Set it to something and try again.

Posted: Thu Dec 01, 2005 12:46 pm
by pickle
Sometimes just setting the From field doesn't work, you need to set an additional -f flag:

Code: Select all

mail($to_address,$subject,$message,$from_address,"-fmyemailaddress@domain.ca");

Posted: Thu Dec 01, 2005 3:19 pm
by s.dot
pickle wrote:Sometimes just setting the From field doesn't work, you need to set an additional -f flag:

Code: Select all

mail($to_address,$subject,$message,$from_address,"-fmyemailaddress@domain.ca");
This happened to me while my DNS was propagating. After it resolved and it was a valid domain name and nameservers, my mail functions no longer need the -f thingermabob.