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
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
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

Migrate, Modernize and Build Java Web Apps on Azure: This live workshop will cover methods to enhance Java application development workflow.

Modern Digital Website Security: Prepare to face any form of malicious web activity and enable your sites to optimally serve your customers.

Kubernetes in the Enterprise: The latest expert insights on scaling, serverless, Kubernetes-powered AI, cluster security, FinOps, and more.

A Guide to Continuous Integration and Deployment: Learn the fundamentals and understand the use of CI/CD in your apps.

Related

  • 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
  • Configuring a Shopify MuleSoft Connector

Trending

  • CI/CD Metrics You Should Be Monitoring
  • CodeCraft: Agile Strategies for Crafting Exemplary Software
  • Scaling SRE Teams
  • Leveraging "INSERT INTO ... RETURNING": Practical Scenarios

Email Connector in Mule 4.0

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

Varun Goyal user avatar by
Varun Goyal
·
Jun. 05, 18 · Tutorial
Like (3)
Save
Tweet
Share
23.1K 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: muletest@eaiesb.com 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

  • 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
  • Configuring a Shopify MuleSoft Connector

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • 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
  • support@dzone.com

Let's be friends: