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

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

How does AI transform chaos engineering from an experiment into a critical capability? Learn how to effectively operationalize the chaos.

Data quality isn't just a technical issue: It impacts an organization's compliance, operational efficiency, and customer satisfaction.

Are you a front-end or full-stack developer frustrated by front-end distractions? Learn to move forward with tooling and clear boundaries.

Developer Experience: Demand to support engineering teams has risen, and there is a shift from traditional DevOps to workflow improvements.

Related

  • Designing a Java Connector for Software Integrations
  • Kafka JDBC Source Connector for Large Data
  • Make Your Integration Seamless By Using Ballerina Client Connectors
  • How to Integrate a Distributed Database With Event Streaming

Trending

  • Software Specs 2.0: Evolving Requirements for the AI Era (2025 Edition)
  • Data Storage and Indexing in PostgreSQL: Practical Guide With Examples and Performance Insights
  • Multi-Cluster Networking With Kubernetes and Docker: Connecting Your Containerized Environment
  • 8 Steps to Proactively Handle PostgreSQL Database Disaster Recovery

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.2K 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

  • Designing a Java Connector for Software Integrations
  • Kafka JDBC Source Connector for Large Data
  • Make Your Integration Seamless By Using Ballerina Client Connectors
  • How to Integrate a Distributed Database With Event Streaming

Partner Resources

×

Comments

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

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: