Ebates Coupons and Cash Back

My {Java} Academy

Learn java and related technologies

If you are working on Mule ESB and wondering how to configure SMTP connector in Mule flow to send emails then below are steps that might help you to do it.

Few Points before we start –

  1. I am on MAC OS X El Capitan (Latest version as of 10/10/2015)
  2. I am using Mule Anypoint Studio 5.3.1 and Mule Enterprise Runtime 3.7 (current latest)

In my demo application, I have one flow which uses DataWeave to convert XML file into JASON format. I wanted to email thisJASON data using Mule. I have two flows here –

Flow 1: Generate JASON file

  1. Read the XML file using File inbound connector.
  2. Convert it into JASON using DataWeave.
  3. Write JASON file to file system using File Outbound connector.
  4. Write converted JASON string to VM endpoint

mule-demo-flow1

Flow 2: Send content via email

mule-demo-flow2

  1. Listen to the content on same VM endpoint where it is being written in Flow 1
  2. Configure SMTP to send out email using iCloud SMTP server. Below are the configuration properties

SMTP_Properties

iCloud SMTP servers as per – https://support.apple.com/en-us/HT202304

Host: smtp.mail.me.com

Port:587

User: This should be your icloud id without @icloud.com. I tried with @icloud.com and it fails to start.

Password: your iCloud password

To: Recipient’s email id

From: This has to be your complete iCloud email id. Using any other email id not associated with your iCloud account would result in error – “com.sun.mail.smtp.SMTPSendFailedException: 550 5.7.0 From address is not one of your addresses.”

After all these settings, If I now start my Mule Server and provide the input file, Flow 1 converts the file to JASON and Flow 2 sends out that data to target recipient using my iCloud account.

Hope this helps!

Happy Coding!


Creative Commons License All posts published in this blog are licensed under a Creative Commons by-nc-sa 4.0 International License.

2009 - 2017 | Mixed with Foundation v5.5.1 | Baked with JBake v2.5.1 | Sitemap | Terms and Usage Policy