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.
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
Create a new user. For example, Username – root, Password – root
Create aliases. Go to the Configurations -> Aliases
Put root@localhost.com for Alias and root@localhost for Real Address.
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
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
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
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
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
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
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
Click Next
Click Next
Check “Manually configure server settings or additional server types”
Click Next
Make sure “Internet E-mail” is selected
Click Next
Check the above settings are correct.
Click Next and Finish.
Now create a test mail and send it to root@localhost.com.
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.
Thanks for your help.
Thanks bro. It worked.