Before you can send emails with PHP, you must change some particular settings in the php.ini file.
After you did the changes and you collide with this error
(Warning: mail() [function.mail]: “sendmail_from” not set in php.ini or custom…..)
you must do the following:
Uncomment the following setting in this file (remove the semicolons at the beginning).
;sendmail_from =
and change this setting to this for example (if localhost)
sendmail_from = localhost@localhost
If this issue occurs on your production server, change the default from address according to your domain, so admin@domain.com
However, this is not necessary. If you don’t want or simply because you can’t change the php.ini file, you can send additional headers, including this one:
From: Nobody <email@domain.com>
Please visit the official PHP manual for more information.
Mail this!
- Comments (0)
- PingBacks (0)
- TrackBacks (0)


» Latest comments