Possible Duplicate:
php mail() function on localhost
I’m trying to do some localhost testing for password recovery on my site, but when I try to send an email, I get the following 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()
Here are the relevant settings in my php.ini file.
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = you@yourdomain
I am not sure what to set these to for localhost testing. I realize that I need to set SMTP to whatever my provider’s mail server is, but I work in a shared office building so I don’t know how to even find out who provides the internet here.
Thanks in advance.
PHP’s mail requires a local mailserver to run.
Edit: As the PHP documentation site for
mail()reveils, you may use a Mail package from PEAR.