Warning: mail() [function.mail]: “sendmail_from” not set in PHP.ini or custom “from:”

Views: 86 Last modified: July 31st, 2011 Comments: 0

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.

VN:F [1.9.13_1145]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

    Mail this!

    To: From:Sum {1+3} =  
    Anything to add ?

        You must be logged in to post a comment.