Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

Email Transport Reference

Introduction

The email transport comprises of several transports for email connectivity. The implementation supports CC/BCC/ReplyTo addresses, attachments, custom Header properties and customizable authentication. See each email transport page for more details.

Configuration Examples

Here is a configuration snippet from the bookstore example. This flow is triggered when you send a string to vm://emailNotification and sends an order verification email to a specified address:


          
       
1
2
3
4
5
6
7
8
<flow name="EmailNotificationService">
    <vm:inbound-endpoint path="emailNotification" exchange-pattern="one-way" />
    <smtps:outbound-endpoint user="${user}" password="${password}" host="${host}" from="${from}"
                             subject="Your order has been placed!">
        <custom-transformer class="org.mule.example.bookstore.transformers.OrderToEmailTransformer" />
        <email:string-to-email-transformer />
    </smtps:outbound-endpoint>
</flow>

Here is a configuration snippet from the errorhandler example. This endpoint takes a ErrorMessageToExceptionBean java object and converts it to an email to a specified address:


          
       
1
2
3
4
5
6
7
8
<smtp:outbound-endpoint user="${smtp.username}" password="${smtp.password}"
                        host="${smtp.host}" port="${smtp.port}"
                        to="${email.toAddress}" from="${email.fromAddress}"
                        subject="${email.subject}">
    <transformer ref="ErrorMessageToExceptionBean" />
    <transformer ref="ExceptionBeanToXML" />
    <email:string-to-email-transformer/>
</smtp:outbound-endpoint>

You can find full working configuration examples in each transport reference page.

The full example code for the bookstore and errorhandler examples are included in the full Mule ESB distribution.

In this topic: