michaelkirby Posted March 22, 2010 Share Posted March 22, 2010 Hi all, I have been investigating how to send email from my application. There are many examples that are available that show how to send a simple message. I understand how this is working but getting a bit confused when it comes to running and the error I get. Once I run the application 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() in C:\xampp\htdocs\Timp\UserLogin\contactusmailform.php on line 9 After investigating this there has been suggestions to change ports etc but i really don't understand the problem. Can anyone help me out at all?? Quote Link to comment Share on other sites More sharing options...
Psycho Posted March 22, 2010 Share Posted March 22, 2010 The configuration in the php.ini file need to point to a mailserver on which you can send email. By default, a XAMPP installation expects that you are running a mailserver on your local machine, thus the localhost entry. The XAMPP package also includes the Mercury mailserver application. You can run that along with the Apache server or you can change the php.ini setting to point to another mailserver. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted March 22, 2010 Share Posted March 22, 2010 You need a properly configured mail server in order to send emails and you need a properly configured public (i.e. one with a domain name associated with it and all the necessary DNS records that allow receiving mail servers to verify that an email came from the correct sending mail server) mail server in order to send an email to anyone other than yourself. The error message is fairly clear that it failed to connect to mailserver at "localhost" port 25, meaning that you don't have a mail server running on your localhost computer using port 25. So, is it your intention to set up a properly configured public mail server on your localhost computer or are you actually wanting to send email through your web host's mail server or your ISP's mail server (such as gmail, hotmail...)? Quote Link to comment Share on other sites More sharing options...
michaelkirby Posted March 22, 2010 Author Share Posted March 22, 2010 Hi, Thanks for the reply. At the moment all I want to do is send emails for a contactUs form and also eventually to get email confirmation to a users email address to verify the account. The email address that I would want the email to come to would be a hotmail account. Do I need to use something like Mercury?? or is their another way? All your help is much appreciated as I'm still learning and don't know how to do everything. Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.