DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • The Real-time Data Transfer Magic of Doris Kafka Connector's "Data Package": Part 1
  • Designing a Java Connector for Software Integrations
  • Kafka JDBC Source Connector for Large Data
  • Make Your Integration Seamless By Using Ballerina Client Connectors

Trending

  • A Zero-Trust Implementation Framework for Cloud Migrations: Lessons From Enterprise Deployments
  • Why Standard Test Automation Misses the Failures That Matter in AI Agent Systems
  • How I Built a Star Wars Grogu Product Research Agent With Codex, Lark, and SerpApi
  • 12 Factor Framework for Building Secure and Compliant Cloud Applications

Email Connector in Mule 4.0

This tutorial will explain the email connector send operation in Mule 4.0 with new Anypoint Studio.

By 
Varun Goyal user avatar
Varun Goyal
·
Jun. 05, 18 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
24.5K Views

Join the DZone community and get the full member experience.

Join For Free

Step 1: Create a New Mule Project named SmptDemo

  • Drag and drop an HTTP Listener Connector to get the request for your service and set the host and port numbers. Here, the host is set to mule4.eaiesb.com and port to 9098 and after configuring, test the connection successfully will specify port is in use or not.
  • Set the URL path for your email service: / and get the message in the body field of your response property.
  • By default Mule 4.0 doesn't have the email Module so in Mule palette click on +Add Module and add the email extension from the list and finish it.

Step 2: Add the Extension and Verify the Following in the Palette 

  • The earlier Mule version has three different connectors for mail like IMAP, POP3, and SMTP, but the Mule 4.0 version has a single email module that has different operations like Delete, Send, List pop 3, List imap as shown below:

Image title

Step 3:

Drag the email connector onto the canvas and configure the SMTP settings. Here, the configuration is Host: smtp.gmail.com , Port: 587 , User: [email protected] and password details of the SMTP as shown:

Image title

  • Go to the Advanced tab and select inline from properties field and add the following:
    • Key: mail.smtp.starttls.enable & Value: true and test that connection is successful.

Image title

Step 4: Give the From address within that To address, Subject, and Body details. Select the Content as text here: Hello Mule4 and ContentType as text/plain.

Image title

Setting the Body and Content below:

Image title

Step 5:

Right-click on canvas and run the Mule Project, and by default, Mule will download the artifacts from the maven repository, and once the project does not have any errors, it will show a successful deployment.

Step 6:

Open the Postman and Hit the Service URL request as shown:

Image title

  • The message is sent successfully in HTTP response property, and the response set for the request, and we can check the message given in the body within the mail ID set in Value of SMTP Connector and is successfully received as mail body:

Image title

Happy learning!

Connector (mathematics)

Opinions expressed by DZone contributors are their own.

Related

  • The Real-time Data Transfer Magic of Doris Kafka Connector's "Data Package": Part 1
  • Designing a Java Connector for Software Integrations
  • Kafka JDBC Source Connector for Large Data
  • Make Your Integration Seamless By Using Ballerina Client Connectors

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook