Jump to content

Need help with mail function


gautham

Recommended Posts

Hi everyone,

I am a beginner. I had tried sending a mail from wamp server. But this message appeared.

 

"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\book\mailform.php on line 13

Thank you for using our mail form "

 

 

What port number should I set in php.ini now?

Link to comment
https://forums.phpfreaks.com/topic/192117-need-help-with-mail-function/
Share on other sites

In order to use localhost you would have to install a mail server on your computer, you would then set the port to whatever port you set your mail server to listen to. It's more likely you don't want to do this, in which case you will need to change the SMTP value and stick to the standard port 25. I know in the UK many ISPs allow you to use their SMTP.

check this in ur command prompt

telnet localhost 25

 

 

if the port is open then it will allow you to send the mail. other wise the only other option left for you is to use the smtp server to send mails..

u can configure the smtp in the php.ini file

 

check this article for your reference

http://articles.sitepoint.com/article/advanced-email-php

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.