phatgreenbuds Posted December 30, 2006 Share Posted December 30, 2006 Below is my very simple code and the error message I get. I am a little unclear on the whole email setup...I did not have a php.ini file to begin with but edited the php.ini.dist file and renamed it to php.ini. I restarted apache and still get this error. What did I miss?ini_set("SMTP", 'x.x.x.x'); $to = '[email protected]';$subject = "test email";$message = "Blah Blah Blah";$headers = 'From: [email protected]' . "\r\n";mail($to, $subject, $message, $headers);ini_restore("SMTP");Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in E:\Program Files\Apache Group\Apache2\test\testmailer.php on line 7 Link to comment https://forums.phpfreaks.com/topic/32247-solved-what-is-wrong-with-this-email/ Share on other sites More sharing options...
Vikas Jayna Posted December 30, 2006 Share Posted December 30, 2006 sendmail_from is a variable defined in php.ini which specifies the email id of the sender of the mail. Check the output of the phpinfo() function and see what this variable contains Link to comment https://forums.phpfreaks.com/topic/32247-solved-what-is-wrong-with-this-email/#findComment-149707 Share on other sites More sharing options...
phatgreenbuds Posted December 30, 2006 Author Share Posted December 30, 2006 figured it out. the php.ini was not in the windows directory so it was not picking it up. Once I put it in the right place it works fine. Link to comment https://forums.phpfreaks.com/topic/32247-solved-what-is-wrong-with-this-email/#findComment-149723 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.