How to send mail from localhost with xampp and mercury32 in Windows

Many of you tried to send mail from localhost for testing some functionality in the website like User Registration, Password Activation etc. in the local or development environment where there is no production mail server available, hence the mail sent is failed. But don’t worry; here I am going to present a tutorial which may help someone who is tired of getting it to work in the localhost.

Requirements

N.B.: Select something like “Send fake mail” checkbox while installing the xampp in windows otherwise you won’t be able to send the mail in localhost.

Only you need to download the xampp package which consists of the required things like a web server, mysql, mail server and a mail client etc. You can also download each thing separately and install to configure them.

The following steps will guide you through the working of mail function on localhost.

Install the xampp package.
Open the control panel for xampp. Start the web server, mysql and mercury.

send mail from localhost using xampp

Click on the “Admin” button next to “Mercury” on xampp control panel. This will open the Mercury control panel. Click on Configurations->Manage Local Users

send mail from localhost using xampp

Create a new user. For example, Username – root, Password – root

send mail from localhost using xampp

Create aliases. Go to the Configurations -> Aliases
Put root@localhost.com for Alias and root@localhost for Real Address.

send mail from localhost using xampp

Go to Configurations -> Mercury Core Modules -> “Local domains” tab
Local host or server: localhost.com
Internet name: [127.0.0.1]
Local host or server: localhost.com
Internet name: localhost

send mail from localhost using xampp

Next, from the Mercury Admin panel, Go to Configurations -> MercuryS SMTP server and make the following Changes.
Announce Myself as: 127.0.0.1
IP Interface to use: 127.0.0.1
Listen to TCP/IP port: 25

send mail from localhost using xampp

Next, from the Mercury Admin Panel, Go to Configurations -> MercuryP POP3 Server and fill in the following details.
Listen to TCP port: 110
IP Interface to use: 127.0.0.1

send mail from localhost using xampp

Go to Configurations -> MercuryD POP3 Client
Click on “Add” button and give the following details:
POP3 Host: 127.0.0.1
Username: root
Password: root

send mail from localhost using xampp

Next, from the Mercury Admin Panel, Go to Configurations ->MercuryE SMTP client Configuration, and make the following changes
Identify Myself as: 127.0.0.1
Name server: 127.0.0.1

send mail from localhost using xampp

Go to Configurations -> MercuryD POP3 Client
Click on “Add” button and give the following details:
POP3 Host: 127.0.0.1
Username: root
Password: root

send mail from localhost using xampp

This finishes Configuration of your Mercury Mail transport system.

We now have to configure a mail client, so as to receive mails. We will use the windows default mail client – the outlook express. The following steps will guide you to create a user account on outlook express.

Setup Microsoft Outlook Express

Click on Microsoft Outlook Express

send mail from localhost using xampp

Click Next

send mail from localhost using xampp

Click Next

send mail from localhost using xampp

Check “Manually configure server settings or additional server types”
Click Next

send mail from localhost using xampp

Make sure “Internet E-mail” is selected

Click Next

send mail from localhost using xampp

Check the above settings are correct.

send mail from localhost using xampp

Click Next and Finish.

Now create a test mail and send it to root@localhost.com.

send mail from localhost using xampp

After sending the message you will get this message in the inbox.

N.B.: Select something like “Send fake mail” checkbox while installing the xampp in windows otherwise you won’t be able to send the mail in localhost.

Thanks for patience. Please do not forget to leave a comment.

Soumitra

Software Professional, I am passionate to work on web/enterprise application. For more information please go to about me. You can follow on Twitter. You can be a friend on Facebook or Google Plus or Linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.