Page 1 of 1

"sendmail_from" not set in php.ini/verify your "SMTP"

Posted: Wed Feb 17, 2010 9:32 am
by gth759k
Just trying to get simple contact form working. The core of the problem is my "mail()" function isn't working correctly. With this simple line:

Code: Select all

 
mail('realemailaddress@gmail.com', 'PHP Mail Test', 'Hello World');
 
I get the error: Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\wamp\www\startup\mailtest.php on line 2

so I added the from header like this:

Code: Select all

 
mail('realemailaddress@gmail.com', 'PHP Mail Test', 'Hello World', 'From: webmaster@example.com');
 
and I get the error: Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\startup\mailtest.php on line 2

Any help would be appreciated. Thanks.

Re: "sendmail_from" not set in php.ini/verify your "SMTP"

Posted: Wed Feb 17, 2010 10:12 am
by emmbec
You need to configure your SMTP server in wamp.

Look for the following in your PHP.ini file and paste in your isp SMTP address:

[mail function]
; For Win32 only.
SMTP = mail.mymailserver.net ; for Win32 only
smtp_port = 25
sendmail_from= php@myhome.com ; for Win32 only