Jump to content

mail() function


gdk123

Recommended Posts

Hi, I am using WAMP5 Server.I'm trying to send an e-mail from a .php script and ie6 returns this 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\mailtest\sendmail.php on line 12 I checked php.ini [mail function]; For Win32 only.SMTP = localhostsmtp_port = 25; For Win32 only.sendmail_from = me@anydomain.com

Link to comment
Share on other sites

Hi!If you use localhost as SMTP you need to have a SMTP-server installed on your system.If you don't know how to install (I'm not sure which server to use for Win) it or don't want to you can use either the one provided (if any) by your ISP, or perhaps gmail or similar...

Link to comment
Share on other sites

Also, when you move your script from your home computer to a server online, it will most likely already have a mail server setup and configured and you won't need to change anything in your code for the mail to work.

Link to comment
Share on other sites

  • 1 month later...
Hi!If you use localhost as SMTP you need to have a SMTP-server installed on your system.If you don't know how to install (I'm not sure which server to use for Win) it or don't want to you can use either the one provided (if any) by your ISP, or perhaps gmail or similar...
Hi,Do you know how is this done with gmail ?I did use smtp.gmail.com as SMTP in php.ini but nothing happens.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...