Hi all,
I use a form to contact with an user and then I need to send data in my e-mail

My code is :

$myemail = "a@hotmail.com";
mail($myemail, $subject, $message, $from);

But when I run my site I take this warning
mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in see in my e-mail I don't have new e-mail.

And when I see in my email box I don't have new.

Could someone help me ??

Thanks a lot

Recommended Answers

All 2 Replies

Took from the php manual:

Note: When sending mail, the mail must contain a From header. This can be set with the additional_headers parameter, or a default can be set in php.ini.
Failing to do this will result in an error message similar to Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing. The From header sets also Return-Path under Windows.

Conclusion: You haven't configured it in your php.ini file :)

You can however do this in the mail function.

Your from variable, we haven't got it can you show us it so as we know what you are doing with it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.