Mule 2.x User Guide > SMTP Transport

View: New views
1 Messages — Rating Filter:   Alert me  

Mule 2.x User Guide > SMTP Transport

by mule-lists :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

SMTP Transport

Page edited by Jackie Wheeler


SMTP Transport

This page is ready for review

The SMTP transport can be used for sending messages over SMTP using the javax.mail API. See the SMTPS Transport for a secure version. The implementation supports CC/BCC/ReplyTo addresses, attachments, custom Header properties, and customizable authentication. It also provides support for javax.mail.Message transformation.

The Javadoc for this transport can be found
here .

Generic SMTP(S) Endpoints

SMTP endpoints describe details about the SMTP server and the recipients of messages sent from the SMTP endpoint. SMTP URIs use the following syntax:

smtp://[user:password@]<smtp server>[MULE::port]?address=<recipient address>

The format is the same for SMTPS -

smtps://[user:password@]<smtp server>[MULE::port]?address=<recipient address>
Escape your credentials

Sometimes you'll have illegal (for URI) characters in your login/password. Use the standard escape syntax your browser would use, e.g. the username user@mule would become user%40mule.

For example:

smtp://muletestbox:123456@...?address=dave@...

This will send mail using smtp.mail.yahoo.co.uk (using the default SMTP port) to the address dave@.... The SMTP request is authenticated using the username muletestbox and the password 123456.

You will probably want to set other information such as subject and fromAddress. These can be set as parameters on the URI, but we recommend you set them as endpoint properties to make it easier to read and maintain the configuration.

<outbound>
  <outbound-pass-through-router>
    <smtp:outbound-endpoint host="localhost" port="65437" from="steve@..."       
                            to="bob@..." subject="Please verify your account details"/>
  </outbound-pass-through-router>
</outbound>

So far, all configuration has been static in that you define all the information in the configuration of the endpoint. However, you can set several MailProperties to control the settings of the outgoing message. These properties will override the endpoint properties. If you always want to set the email address dynamically, you can leave out the address parameter on the SMTP endpoint.

Connector

Child Elements of <connector...>

Name Cardinality Description
header 0..1 Additional header name and value, added to the message.
header 0..1 Additional header name and value, added to the message.

Outbound endpoint

Attributes of <outbound-endpoint...>

Name Type Required Default Description
to string no   The destination for the email.
from string no   The address of the sender of the email.
subject string no   The email subject.
cc string no   A comma separated list of email addresses to carbon copy to.
bcc string no   A comma separated list of email addresses to blind carbon copy to.
replyTo string no   The address used by default if someone replies to the email.
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
LightInTheBox - Buy quality products at wholesale price