hMailServer is a free, open source, e-mail server for Microsoft Windows. It supports the common e-mail protocols like IMAP, SMTP and POP3.

Let’s have a look at a simple example of sending emails using hMailServer Administrator. Here, hMail administrative server is used for configuring email server on local machine. We need to do following 3 steps for sending emails via MuleSoft:

hMail server setup on local machine for setting up email server and creating domain and different usernames

Mulesoft project setup

Outlook configuration for viewing mails

Steps for configuration:

hMail setup

1. Download latest version of hMailServer from internet and execute the exe.

2. Provide the admin password while installation of hMailServer. It will be required for admin purposes and for connecting to domains.

3. On the hMailServer UI, click on Add domain and enter any domain you like. I have selected localhost which is the default domain for this. Click Connect button after highlighting the localhost domain. This will prompt for the password. Provide the admin password set in step 2. Your hMailServer Administrator is now connected.

4. The next step is to add accounts to your server. I have added 2 accounts under localhost.com (ekta@localhost.com and jayesh@localhost.com). To do this expand the Domains node in the tree to the left. Click on the domain localhost.com and Click Add account. Do settings for the added accounts as in the below image. You can add any number of accounts. For test purposes I have added only 2 accounts as seen in the image below.

5. I have also set Auto reply just for testing purposes as below.

6. Under Settings -> Protocols, following should be selected.

7. Under Advanced-> IP ranges -> My computer, do the following changes:

Project setup

1. Below is the sample flow for sending emails using Mulesoft as an ESB. Here, SMTP connector is used for configuring mail properties.

5. Click next for completing the outlook configuration. You can add other account similarly.

6. Now execute the mule project to see if you can receive the mail from one user to another in your outlook mail box. Make sure that the hmail instance is open locally. Also see if you have received the Auto reply in case you have set it like me.

One Response to “Send emails using hMail server with Mule as an ESB”

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.

MuleSoft provides the most widely used integration platform for connecting any application, data source or API, whether in the cloud or on-premises. With Anypoint Platform®, MuleSoft delivers a complete integration experience built on proven open source technology, eliminating the pain and cost of point-to-point integration. Anypoint Platform includes CloudHub™ iPaaS, Mule ESB™, and a unified solution for API management™, design and publishing.