Regarding Mail function

Category: Email

Mahesh
Asked:
2013-05-13 7:40 am EST

Hits: 1,470
Hi, I created a small register form and tried to use the mail function. But i received an error saying, Warning: 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\php_sandbox\register.php on line 43

Can you kindly let me know how to connect to the SMTP server as i am new to PHP and still in the process of learning.

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

Scott
Staff
20,328 Points
2013-05-13 10:09 am EST
Hello Mahesh,

I see you are using WAMP on your local machine. by default, the SMTP protocol is not set up on a PC. Your setup is looking at 'localhost' which means it is looking to your local machine. You can certainly use the mail function, but you must set up the SMTP settings to look to a live mail server that you have an email account on.

The port will stay the same, but the host will need to be either the mail server's IP address or domain name.

Best Regards,
Scott M

You must login before you can post a comment about this answer.

Hi Scott,

Thanks for the info. Can you explain a bit more clear about how i can make the SMTP settings with an example. Because i have tried different materials but they were saying to set the ISP's SMTP.

Your reply would be much helpful for me and thanks in advance for sharing the info.
Mahesh
8 Points
2013-05-14 1:41 am EST
Like this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!