Page 1 of 1

Mail Function Error

Posted: Fri Jul 23, 2010 10:01 am
by emilcarlo
Good Evening,

I found a tutorial that really helped me a lot on my project requirement. Here's the link http://swish-db.com/tutorials/view.php/tid/601. I am still in the process of familiarizing php codes, and hopefully I can grasp them immediately since I need it on my job. I did some modifications since the database I am connecting is different from that of the tutorial, and I know the modifications I made, based of course on my references is correct. However, i had this output after I tried to use the registration function:

You have successfully Registered
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:\xampp\htdocs\sample\register.php on line 54
Your information has been mailed to your email address.

To my understanding, the code for registration is correct, the only error the code stumbled upon is the mail function. Can anyone help me with this one? I am a newbie with php programming (actually with programming) and I am lost what or where to search the error I got.

Appreciate all your help, thank you in advanced ^^

Re: Mail Function Error

Posted: Fri Jul 23, 2010 11:30 am
by lshaw
Do you have a smtp server running on port 25 of your computer? If you havn't, just search free SMTP server on google, but if you can't be bothered with that(as it takes a lot of setup), You can use your email providers SMTP server to send mail. If you use gmail, the server is smtp.gmail.com, but the security of gmail makes it hard to set up, so you ISP's smtp server would be better, or any server that doesn't require SSL/TLS, and authentication. BUT, If you put to much stress on an smtp server that you are not running locally, your email provider may not be too happy, so it would be better if you set up your own in the long term for mass mailing etc.

Re: Mail Function Error

Posted: Mon Jul 26, 2010 11:51 am
by emilcarlo
lshaw wrote:Do you have a smtp server running on port 25 of your computer? If you havn't, just search free SMTP server on google, but if you can't be bothered with that(as it takes a lot of setup), You can use your email providers SMTP server to send mail. If you use gmail, the server is smtp.gmail.com, but the security of gmail makes it hard to set up, so you ISP's smtp server would be better, or any server that doesn't require SSL/TLS, and authentication. BUT, If you put to much stress on an smtp server that you are not running locally, your email provider may not be too happy, so it would be better if you set up your own in the long term for mass mailing etc.
Sorry, I really didn't understand this much xD We have email provider, but how do I set the email server on the pc? Thank you very much.