SlideShare a Scribd company logo
1 of 17
Vamsi Krishna M
• Mule ESB is a lightweight Java-based enterprise service bus (ESB)
and integration platform that allows developers to connect
applications together quickly and easily, enabling them to
exchange data. Mule ESB enables easy integration of existing
systems, regardless of the different technologies that the
applications use, including JMS, Web Services, JDBC, HTTP, and
more.
• This example shows how we can send email attachment using SMTP
connector to self or another email. We simply put a file in a source
directory and Mule will read the file from the source directory. Using
Mule ESB it’s very easy to read the file from a location. If we had to
read the file using manual coding then we had to write many lines of
code. But using Mule ESB we just simply put a file in a directory and let
the Mule know the file path and Mule does the rest of the thing. You can
put any kind of file to the source for reading. The file that we put into a
source directory will be an attachment to the intended recipient’s mail
address. So finally when we will see the file as an attachment in the
mailbox.
• Attachment transformer lets us attach a file or document
which will be sent to the email address.
• The SMTP endpoint allows Mule messages to be sent as email or
email attachments with the Simple Mail Transfer Protocol (SMTP)
using Java mail API.
• Mule Studio 3.5.1
JDK 1.6
Maven 3
Mule Runtime 3.5.0 CE
Knowledge of XML
• Open Mule Studio and create a mule project. Go to File->New-
>Mule Project. Now enter the Project Name, selectRuntime – Mule
Server, check the check box for Use Maven. Now enter the
following information
• Group Id: your Mail(ex. gmail.com)
Artifact Id: project name – file-attachment(automatically
populated when project name is getting typed)
V
• Click Next and verify project Location and JRE/JDK are set
correctly. Click Finishersion: Mule studio generates default
• Now drag and drop the elements from right side of the Mule
studio as shown below in the picture.
Browse and select the path from where a file will be read for an attachment.
Logger component properties
• File to String transformer properties
• File-to-Strong transformer just transforms the file object to
human readable string format. We will not set any property
for this element
Attachment transformer properties
• Using attachment transformer we can set payload from
previous flow as an attachment. We have to select Content
Type, operation as Set Attachment, Name, Value
• SMTP connector properties
For SMTP connector we have to input email host, user name, password,
port under Basic Settings and To Address, From Address, Subject under
Email Information.
• The whole XML file of entire flow
• <?xml version="1.0" encoding="UTF-8"?>
•
• <mule xmlns:smtp="http://www.mulesoft.org/schema/mule/smtp"
• xmlns:file="http://www.mulesoft.org/schema/mule/file" 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="CE-3.5.0"
• 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/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
• http://www.mulesoft.org/schema/mule/smtp http://www.mulesoft.org/schema/mule/smtp/current/mule-
smtp.xsd">
• <flow name="file-attachmentFlow1" doc:name="file-attachmentFlow1">
• <file:inbound-endpoint path="D:AnypointWorkspacesource"
• responseTimeout="10000" doc:name="File" />
• <logger message="#[payload]" level="INFO" doc:name="Logger" />
• <file:file-to-string-transformer
• doc:name="File to String" />
• <logger message="#[payload]" level="INFO" doc:name="Logger" />
• <set-attachment attachmentName="attachment" value="#[payload]"
• contentType="text/plain" doc:name="Attachment" />
• <logger message="#[payload]" level="INFO" doc:name="Logger" />
• <smtp:outbound-endpoint host="mail.domain.com"
• user="emailAddress@domain.com" password="password" to="emailAddress@domain.com"
• from="emailAddress@domain.com" subject="Test Email" responseTimeout="10000"
• doc:name="SMTP" />
• <logger message="#[payload]" level="INFO" doc:name="Logger" />
• </flow>
• </mule>
• Now create a text file called file-attachment.txt and put it under
selected path, i.e., as per the above XML the file path
is E:AnypointWorkspacesource.
• Do right-click on file-attachment.xml and click on Run As -> Mule
Application with Maven. Once the application up and running you will
get the console output and email attachment in your mailbox where
you have sent the email.
• Output in console
• INFO 2015-12-17 09:25:46,372 [[file-attachment].connector.file.mule.default.receiver.01]
org.mule.transport.file.FileMessageReceiver: Lock obtained on file:
E:AnypointWorkspacesourcefile-attachment.txt
• INFO 2015-12-17 09:25:46,404 [[file-attachment].file-attachmentFlow1.stage1.02]
org.mule.api.processor.LoggerMessageProcessor:
org.mule.transport.file.ReceiverFileInputStream@6a150e
• INFO 2015-12-17 09:25:46,406 [[file-attachment].file-attachmentFlow1.stage1.02]
org.mule.api.processor.LoggerMessageProcessor: This is a file content
• INFO 2015-12-17 09:25:46,407 [[file-attachment].file-attachmentFlow1.stage1.02]
org.mule.api.processor.LoggerMessageProcessor: This is a file content
• INFO 2015-12-17 09:25:46,419 [[file-attachment].file-attachmentFlow1.stage1.02]
org.mule.api.processor.LoggerMessageProcessor: This is a file content
• INFO 2015-12-17 09:25:46,422 [[file-
attachment].connector.smtp.mule.default.dispatcher.01]
org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default outbound
transformer: org.mule.transport.email.transformers.ObjectToMimeMessage
• INFO 2015-12-17 09:25:46,428 [[file-
attachment].connector.smtp.mule.default.dispatcher.01]
org.mule.lifecycle.AbstractLifecycleManager: Initialising:
'connector.smtp.mule.default.dispatcher.1213248'. Object is: SmtpMessageDispatcher
• INFO 2015-12-17 09:25:48,878 [[file-
attachment].connector.smtp.mule.default.dispatcher.01]
org.mule.lifecycle.AbstractLifecycleManager: Starting:
'connector.smtp.mule.default.dispatcher.1213248'. Object is: SmtpMessageDispatcher
• Click on the attachment. You will see the below output in the browser.

More Related Content

What's hot

Database component in mule
Database component in muleDatabase component in mule
Database component in muleRajkattamuri
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo javeed_mhd
 
Vm component in mule
Vm component in muleVm component in mule
Vm component in mulejaveed_mhd
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in muleRajkattamuri
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in MuleMohammed246
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mulejaveed_mhd
 
File component in mule
File component in muleFile component in mule
File component in muleRajkattamuri
 
How to – wrap soap web service around a database
How to – wrap soap web service around a databaseHow to – wrap soap web service around a database
How to – wrap soap web service around a databaseSon Nguyen
 
File connector mule
File connector   muleFile connector   mule
File connector muleSindhu VL
 
Mulesoft Consuming Web Service - Web Service Consumer
Mulesoft Consuming Web Service - Web Service ConsumerMulesoft Consuming Web Service - Web Service Consumer
Mulesoft Consuming Web Service - Web Service ConsumerVince Soliza
 
Mule system properties
Mule system propertiesMule system properties
Mule system propertiesRavinder Singh
 

What's hot (19)

Mule esb file to-string flow
Mule esb file to-string flowMule esb file to-string flow
Mule esb file to-string flow
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mule
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
 
Dynamic file attribute
Dynamic file attributeDynamic file attribute
Dynamic file attribute
 
xslt in mule
xslt in mulexslt in mule
xslt in mule
 
Mule velocity
Mule velocityMule velocity
Mule velocity
 
Propertiesinmule
PropertiesinmulePropertiesinmule
Propertiesinmule
 
Vm component in mule
Vm component in muleVm component in mule
Vm component in mule
 
Setting filedynamically
Setting filedynamicallySetting filedynamically
Setting filedynamically
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
 
Mule esb :Data Weave
Mule esb :Data WeaveMule esb :Data Weave
Mule esb :Data Weave
 
Java mule
Java muleJava mule
Java mule
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mule
 
File component in mule
File component in muleFile component in mule
File component in mule
 
How to – wrap soap web service around a database
How to – wrap soap web service around a databaseHow to – wrap soap web service around a database
How to – wrap soap web service around a database
 
File connector mule
File connector   muleFile connector   mule
File connector mule
 
Mulesoft Consuming Web Service - Web Service Consumer
Mulesoft Consuming Web Service - Web Service ConsumerMulesoft Consuming Web Service - Web Service Consumer
Mulesoft Consuming Web Service - Web Service Consumer
 
Mule system properties
Mule system propertiesMule system properties
Mule system properties
 

Viewers also liked

Business BVI Janury 2016 Edition - The BVI - Corporate Evolution Serving Glob...
Business BVI Janury 2016 Edition - The BVI - Corporate Evolution Serving Glob...Business BVI Janury 2016 Edition - The BVI - Corporate Evolution Serving Glob...
Business BVI Janury 2016 Edition - The BVI - Corporate Evolution Serving Glob...Greg Boyd
 
Instituto tecnológico de nor oriente
Instituto tecnológico de nor orienteInstituto tecnológico de nor oriente
Instituto tecnológico de nor orienteCelesteOrellana98
 
Communications Management Plan
Communications Management PlanCommunications Management Plan
Communications Management PlanJonathan Reid
 
Bootiful Invitation Email
Bootiful Invitation EmailBootiful Invitation Email
Bootiful Invitation EmailGerry Fraenkel
 
Developing effective mobile policy
Developing effective mobile policyDeveloping effective mobile policy
Developing effective mobile policyWendyvanmeer
 
Exposición Albacete Siempre
Exposición Albacete SiempreExposición Albacete Siempre
Exposición Albacete SiempreAlbacete
 
Transcripción de chat de atención al cliente
Transcripción de chat de atención al clienteTranscripción de chat de atención al cliente
Transcripción de chat de atención al clienteZulimaMoncada
 
The Unlikely Candidates: Digital Strategy
The Unlikely Candidates: Digital StrategyThe Unlikely Candidates: Digital Strategy
The Unlikely Candidates: Digital StrategyAdrianna Ryles
 
Santuario de La Esperanza (Calasparra) Murcia
Santuario de La Esperanza (Calasparra) MurciaSantuario de La Esperanza (Calasparra) Murcia
Santuario de La Esperanza (Calasparra) MurciaApala .
 
Sarah GordonCV (2)
Sarah GordonCV (2)Sarah GordonCV (2)
Sarah GordonCV (2)Sarah Gordon
 
Oslabená imunita
Oslabená imunitaOslabená imunita
Oslabená imunitaimunoglukan
 
Invertir en españa 2015 (ENG)
Invertir en españa 2015 (ENG)Invertir en españa 2015 (ENG)
Invertir en españa 2015 (ENG)Núria Sasrous
 

Viewers also liked (20)

Collage
CollageCollage
Collage
 
Business BVI Janury 2016 Edition - The BVI - Corporate Evolution Serving Glob...
Business BVI Janury 2016 Edition - The BVI - Corporate Evolution Serving Glob...Business BVI Janury 2016 Edition - The BVI - Corporate Evolution Serving Glob...
Business BVI Janury 2016 Edition - The BVI - Corporate Evolution Serving Glob...
 
Instituto tecnológico de nor oriente
Instituto tecnológico de nor orienteInstituto tecnológico de nor oriente
Instituto tecnológico de nor oriente
 
Communications Management Plan
Communications Management PlanCommunications Management Plan
Communications Management Plan
 
Bootiful Invitation Email
Bootiful Invitation EmailBootiful Invitation Email
Bootiful Invitation Email
 
Sabemos lo que comemos
Sabemos lo que comemos Sabemos lo que comemos
Sabemos lo que comemos
 
Developing effective mobile policy
Developing effective mobile policyDeveloping effective mobile policy
Developing effective mobile policy
 
Exposición Albacete Siempre
Exposición Albacete SiempreExposición Albacete Siempre
Exposición Albacete Siempre
 
Transcripción de chat de atención al cliente
Transcripción de chat de atención al clienteTranscripción de chat de atención al cliente
Transcripción de chat de atención al cliente
 
The Unlikely Candidates: Digital Strategy
The Unlikely Candidates: Digital StrategyThe Unlikely Candidates: Digital Strategy
The Unlikely Candidates: Digital Strategy
 
Validación ebt2
Validación ebt2Validación ebt2
Validación ebt2
 
Promotin g Inclusive growth through the 4Ps
Promotin g Inclusive growth through the 4PsPromotin g Inclusive growth through the 4Ps
Promotin g Inclusive growth through the 4Ps
 
Santuario de La Esperanza (Calasparra) Murcia
Santuario de La Esperanza (Calasparra) MurciaSantuario de La Esperanza (Calasparra) Murcia
Santuario de La Esperanza (Calasparra) Murcia
 
Sarah GordonCV (2)
Sarah GordonCV (2)Sarah GordonCV (2)
Sarah GordonCV (2)
 
Oslabená imunita
Oslabená imunitaOslabená imunita
Oslabená imunita
 
Invertir en españa 2015 (ENG)
Invertir en españa 2015 (ENG)Invertir en españa 2015 (ENG)
Invertir en españa 2015 (ENG)
 
Diario
DiarioDiario
Diario
 
Administración operativa por Ricardo Estevez
Administración operativa por Ricardo EstevezAdministración operativa por Ricardo Estevez
Administración operativa por Ricardo Estevez
 
2 f-ciencias
2 f-ciencias2 f-ciencias
2 f-ciencias
 
28 May Indianhead
28 May Indianhead28 May Indianhead
28 May Indianhead
 

Similar to Email configuration in mule esb

Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esbAnand kalla
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esbPraneethchampion
 
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esbPhaniu
 
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esbirfan1008
 
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esbprinceirfancivil
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esbRaviShankar Mishra
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSreekanth Kondapalli
 
Mule connectors-part 1
Mule connectors-part 1Mule connectors-part 1
Mule connectors-part 1VirtusaPolaris
 
Muleesbcomponents1 160625154208
Muleesbcomponents1 160625154208Muleesbcomponents1 160625154208
Muleesbcomponents1 160625154208ppts123456
 
Mule esb and_relevant_components
Mule esb and_relevant_componentsMule esb and_relevant_components
Mule esb and_relevant_componentsPaaras Baru
 
Mule ESB Components
Mule ESB Components Mule ESB Components
Mule ESB Components pat_91
 
File component
File component File component
File component F K
 
File component in mule
File component in muleFile component in mule
File component in mulejaveed_mhd
 

Similar to Email configuration in mule esb (20)

Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esb
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esb
 
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esb
 
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esb
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Mule connectors-part 1
Mule connectors-part 1Mule connectors-part 1
Mule connectors-part 1
 
Mule connectors-session1
Mule connectors-session1Mule connectors-session1
Mule connectors-session1
 
Mule ESB
Mule ESBMule ESB
Mule ESB
 
Muleesbcomponents1 160625154208
Muleesbcomponents1 160625154208Muleesbcomponents1 160625154208
Muleesbcomponents1 160625154208
 
Mule esb and_relevant_components
Mule esb and_relevant_componentsMule esb and_relevant_components
Mule esb and_relevant_components
 
Mule esb
Mule esbMule esb
Mule esb
 
MuleSoft ESB XML to CSV
MuleSoft ESB XML to CSVMuleSoft ESB XML to CSV
MuleSoft ESB XML to CSV
 
Mule ESB Components
Mule ESB Components Mule ESB Components
Mule ESB Components
 
File component
File component File component
File component
 
Mule File component
Mule File component Mule File component
Mule File component
 
File component
File component File component
File component
 
File component in mule
File component in muleFile component in mule
File component in mule
 
MuleSoft ESB CSV to XML
MuleSoft ESB CSV to XMLMuleSoft ESB CSV to XML
MuleSoft ESB CSV to XML
 

More from Vamsi Krishna

Mulesoft - Documentation (Automation)
Mulesoft - Documentation (Automation)Mulesoft - Documentation (Automation)
Mulesoft - Documentation (Automation)Vamsi Krishna
 
Debug Program in Mule
Debug Program in MuleDebug Program in Mule
Debug Program in MuleVamsi Krishna
 
Mule esb intoduction
Mule esb intoductionMule esb intoduction
Mule esb intoductionVamsi Krishna
 
Architecture of mule
Architecture of muleArchitecture of mule
Architecture of muleVamsi Krishna
 
How to create users with anypoint studio
How to create users with anypoint studioHow to create users with anypoint studio
How to create users with anypoint studioVamsi Krishna
 
Implementation in mule esb
Implementation in mule esbImplementation in mule esb
Implementation in mule esbVamsi Krishna
 

More from Vamsi Krishna (10)

Mulesoft - Documentation (Automation)
Mulesoft - Documentation (Automation)Mulesoft - Documentation (Automation)
Mulesoft - Documentation (Automation)
 
Debug Program in Mule
Debug Program in MuleDebug Program in Mule
Debug Program in Mule
 
Mule esb intoduction
Mule esb intoductionMule esb intoduction
Mule esb intoduction
 
Mule connectors
Mule connectorsMule connectors
Mule connectors
 
Architecture of mule
Architecture of muleArchitecture of mule
Architecture of mule
 
How to create users with anypoint studio
How to create users with anypoint studioHow to create users with anypoint studio
How to create users with anypoint studio
 
Mule integration
Mule integrationMule integration
Mule integration
 
Mule SIS
Mule SISMule SIS
Mule SIS
 
Hadoop connector
Hadoop connectorHadoop connector
Hadoop connector
 
Implementation in mule esb
Implementation in mule esbImplementation in mule esb
Implementation in mule esb
 

Recently uploaded

Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 

Recently uploaded (20)

Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

Email configuration in mule esb

  • 2. • Mule ESB is a lightweight Java-based enterprise service bus (ESB) and integration platform that allows developers to connect applications together quickly and easily, enabling them to exchange data. Mule ESB enables easy integration of existing systems, regardless of the different technologies that the applications use, including JMS, Web Services, JDBC, HTTP, and more.
  • 3. • This example shows how we can send email attachment using SMTP connector to self or another email. We simply put a file in a source directory and Mule will read the file from the source directory. Using Mule ESB it’s very easy to read the file from a location. If we had to read the file using manual coding then we had to write many lines of code. But using Mule ESB we just simply put a file in a directory and let the Mule know the file path and Mule does the rest of the thing. You can put any kind of file to the source for reading. The file that we put into a source directory will be an attachment to the intended recipient’s mail address. So finally when we will see the file as an attachment in the mailbox.
  • 4. • Attachment transformer lets us attach a file or document which will be sent to the email address.
  • 5. • The SMTP endpoint allows Mule messages to be sent as email or email attachments with the Simple Mail Transfer Protocol (SMTP) using Java mail API.
  • 6. • Mule Studio 3.5.1 JDK 1.6 Maven 3 Mule Runtime 3.5.0 CE Knowledge of XML
  • 7. • Open Mule Studio and create a mule project. Go to File->New- >Mule Project. Now enter the Project Name, selectRuntime – Mule Server, check the check box for Use Maven. Now enter the following information • Group Id: your Mail(ex. gmail.com) Artifact Id: project name – file-attachment(automatically populated when project name is getting typed) V • Click Next and verify project Location and JRE/JDK are set correctly. Click Finishersion: Mule studio generates default
  • 8. • Now drag and drop the elements from right side of the Mule studio as shown below in the picture.
  • 9.
  • 10. Browse and select the path from where a file will be read for an attachment. Logger component properties
  • 11. • File to String transformer properties • File-to-Strong transformer just transforms the file object to human readable string format. We will not set any property for this element Attachment transformer properties
  • 12. • Using attachment transformer we can set payload from previous flow as an attachment. We have to select Content Type, operation as Set Attachment, Name, Value
  • 13. • SMTP connector properties For SMTP connector we have to input email host, user name, password, port under Basic Settings and To Address, From Address, Subject under Email Information.
  • 14. • The whole XML file of entire flow • <?xml version="1.0" encoding="UTF-8"?> • • <mule xmlns:smtp="http://www.mulesoft.org/schema/mule/smtp" • xmlns:file="http://www.mulesoft.org/schema/mule/file" 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="CE-3.5.0" • 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/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd • http://www.mulesoft.org/schema/mule/smtp http://www.mulesoft.org/schema/mule/smtp/current/mule- smtp.xsd"> • <flow name="file-attachmentFlow1" doc:name="file-attachmentFlow1"> • <file:inbound-endpoint path="D:AnypointWorkspacesource" • responseTimeout="10000" doc:name="File" /> • <logger message="#[payload]" level="INFO" doc:name="Logger" /> • <file:file-to-string-transformer • doc:name="File to String" /> • <logger message="#[payload]" level="INFO" doc:name="Logger" /> • <set-attachment attachmentName="attachment" value="#[payload]" • contentType="text/plain" doc:name="Attachment" /> • <logger message="#[payload]" level="INFO" doc:name="Logger" /> • <smtp:outbound-endpoint host="mail.domain.com" • user="emailAddress@domain.com" password="password" to="emailAddress@domain.com" • from="emailAddress@domain.com" subject="Test Email" responseTimeout="10000" • doc:name="SMTP" /> • <logger message="#[payload]" level="INFO" doc:name="Logger" /> • </flow> • </mule>
  • 15. • Now create a text file called file-attachment.txt and put it under selected path, i.e., as per the above XML the file path is E:AnypointWorkspacesource. • Do right-click on file-attachment.xml and click on Run As -> Mule Application with Maven. Once the application up and running you will get the console output and email attachment in your mailbox where you have sent the email.
  • 16. • Output in console • INFO 2015-12-17 09:25:46,372 [[file-attachment].connector.file.mule.default.receiver.01] org.mule.transport.file.FileMessageReceiver: Lock obtained on file: E:AnypointWorkspacesourcefile-attachment.txt • INFO 2015-12-17 09:25:46,404 [[file-attachment].file-attachmentFlow1.stage1.02] org.mule.api.processor.LoggerMessageProcessor: org.mule.transport.file.ReceiverFileInputStream@6a150e • INFO 2015-12-17 09:25:46,406 [[file-attachment].file-attachmentFlow1.stage1.02] org.mule.api.processor.LoggerMessageProcessor: This is a file content • INFO 2015-12-17 09:25:46,407 [[file-attachment].file-attachmentFlow1.stage1.02] org.mule.api.processor.LoggerMessageProcessor: This is a file content • INFO 2015-12-17 09:25:46,419 [[file-attachment].file-attachmentFlow1.stage1.02] org.mule.api.processor.LoggerMessageProcessor: This is a file content • INFO 2015-12-17 09:25:46,422 [[file- attachment].connector.smtp.mule.default.dispatcher.01] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default outbound transformer: org.mule.transport.email.transformers.ObjectToMimeMessage • INFO 2015-12-17 09:25:46,428 [[file- attachment].connector.smtp.mule.default.dispatcher.01] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'connector.smtp.mule.default.dispatcher.1213248'. Object is: SmtpMessageDispatcher • INFO 2015-12-17 09:25:48,878 [[file- attachment].connector.smtp.mule.default.dispatcher.01] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'connector.smtp.mule.default.dispatcher.1213248'. Object is: SmtpMessageDispatcher
  • 17. • Click on the attachment. You will see the below output in the browser.