Mule SMTP Connector
This tutorial explains about the Mule SMTP connector configuration. This can be used to send emails.
Pre-requisites:
- Anypoint Studio 5.1.0
- Any email smtp connection details like yahoo
Mule Flow:
Set message as payload (i.e. Test Message). This will be the email message.
SMTP Connector Configuration:
Source code:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:smtp="http://www.mulesoft.org/schema/mule/smtp"
xmlns:http="http://www.mulesoft.org/schema/mule/http"xmlns:smtps="http://www.mulesoft.org/schema/mule/smtps"
xmlns="http://www.mulesoft.org/schema/mule/core"xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/smtp http://www.mulesoft.org/schema/mule/smtp/current/mule-smtp.xsd
http://www.mulesoft.org/schema/mule/smtps http://www.mulesoft.org/schema/mule/smtps/current/mule-smtps.xsd">
<http:listener-config name="HTTP_Listener_Configuration"
host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration" />
<flow name="yahooemailFlow">
<http:listener config-ref="HTTP_Listener_Configuration"
path="/" doc:name="HTTP" />
<set-payload value="#['Test Message ']" doc:name="Set Payload" />
<smtps:outbound-endpoint host="${smtp_host_ip}"
responseTimeout="10000" doc:name="SMTP" from="fromemail@yahoo.com"
mimeType="text/html" password="password" subject="subject"
to="toemail@yahoo.com" user="fromemail%40yahoo.com" />
<logger message="Mail Sent #[payload]" level="INFO" doc:name="Logger" />
</flow>
</mule>
|
ReplyDeleteExcellent website. Lots of useful information here, thanks in your effort! . For more information please visit
Mulesoft online training
Excellent article and with lots of information. I really learned a lot here. Do share more like this.
ReplyDeleteBlue Prism Training in Chennai
UiPath Course in Chennai
Blue Prism Course in Chennai
UiPath Online Course
Great Post!!! thanks for sharing with us.
ReplyDeletethe importance of google analytics
google analytics significance
Nice informative content. Thanks for sharing the valuable information.
ReplyDeleteRobotics Process Automation Training in Chennai
RPA Certification Course
RPA Training In Marathahalli