Jump to content

Recommended Posts

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??

 

 

Link to comment
https://forums.phpfreaks.com/topic/196153-sending-email-using-xampp/
Share on other sites

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.

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...)?

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!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.