How To Send Email From Localhost With XAMPP And Mercury32 In Windows

Table of Contents

Introduction

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.

This tutorial may contain some old images of XAMPP server and MS Outlook express but the content of this tutorial is up to date and tested with XAMPP version up to 3.3.0.

Prerequisites

XAMPP 3.2.1 – 3.3.0

N.B.: Select “Fake Sendmail” 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 items like a web server, mysql, mail server and a mail client etc. You can also download each thing separately and install to configure them.

Install XAMPP

Once XAMPP downloaded, install it by double clicking on the exe file.

xampp install

Do not forget to check Mercury Mail Server and Fake Sendmail check boxes as highlighted.

fake sendmail

Choose location for installation of XAMPP.

xampp install

Choose language for your XAMPP.

xampp install

Now wait for its installation complete.

xampp install

Configure XAMPP for sending Email

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

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.

Setup Email Clients

I now have to configure a mail client, so as to receive mails. I will use the windows default mail client – the outlook express and eM Client. You can also use other email clients for your application. If your MS Outlook is setup for any other email server then you can find alternative email clients and setup.

Setup Microsoft Outlook Express

The following steps will guide you to create a user account on 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.

Sending Email using Outlook

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.

Setup eM Client

You can easily download from the internet eM Client for composing and sending emails.

Once you download eM client you can setup it easily:

em client setup

Once em client setup done, you can start it:

em client start

When you start first time you have to setup an account and I will show you how to do that in few steps.

You can also choose a theme for your em client.

em client theme

Your em client inbox will have a default email.

Though you got default account and you got an email in the inbox after successful setup of eM client, but you won’t be able to send any email using Mercury email server. You need to setup an account first. I will show you here how to setup an account in eM client.

From the Menu click on Accounts…

em account

Now put the email address in the next screen and click on Next button.

email in em client

Next you need to setup incoming server and user credentials.

incoming server em client

Setup outgoing server.

outgoing server em client

Test the configuration. SMTP is failed but POP3 success. So, I will use POP3 to send email.

pop3 em client

Account details. Setup your name and email.

account details em client

For localhost I am not using any encryption.

encryption em client

Specify the storage option for em client.

storage em client

Thus it finished eM client configurations.

Sending Email using eM Client

Now compose an email and send it.

em client email

So you received the above email in your inbox (unread).

email em client

That’s all how to configure eM client and send email using eM client.

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

6 thoughts on “How To Send Email From Localhost With XAMPP And Mercury32 In Windows

  1. Thank you.

    I have been looking for a solution to test sending email since learning that Gmail no longer accepts email from outside.
    Please show the correct php.ini changes, and any others needed.

    — Fred

Leave a Reply

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