Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The MailTo transport supports sending messages (E-Mail) over SMTP and receiving messages over POP3 or IMAP. This transport implementation is available as a module of the WS-Commons Transports project. 

...

Anchor
enableMailTo
enableMailTo
To enable the MailTo transport sender

Edit the <EI_HOME>/conf/axis2/axis2.xml file and uncomment the MailTo sender as follows:

Code Block
languagehtml/xml
<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
    <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
    <parameter name="mail.smtp.port">587</parameter>
    <parameter name="mail.smtp.starttls.enable">true</parameter>
    <parameter name="mail.smtp.auth">true</parameter>
    <parameter name="mail.smtp.user">synapse.demo.0</parameter>
    <parameter name="mail.smtp.password">mailpassword</parameter>
    <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
</transportSender>
Note

Be sure to import the SSL certificate of your SMTP host server (specified by the mail.smtp.host parameter) to the client trust store of your ESB. The ESB will use the trusted certificates in this client trust store to validate the identity of the SMTP server.

When importing the certificate, be sure to use a certificate alias that is relevant to your server. For example, if you are using Gmail, use 'smtp.gmail.com' as the certificate alias. See the instructions on importing certificates to a keystore.

Info
titleNote

If you want to use multiple mail boxes to send emails, you can have multiple MailTo senders in the <EI_HOME>/conf/axis2/axis2.xml file and include the name of the relevant <transportSender> in the synapse configuration to use a particular mail box.

For example, if you edit the <EI_HOME>/conf/axis2/axis2.xml file and add the following <transportSender>:

Code Block
<transportSender name="mailtoWSO2" class="org.apache.axis2.transport.mail.MailTransportSender">
        <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
        <parameter name="mail.smtp.port">587</parameter>
        <parameter name="mail.smtp.starttls.enable">true</parameter>
        <parameter name="mail.smtp.auth">true</parameter>
        <parameter name="mail.smtp.user">synapse.demo.0</parameter>
        <parameter name="mail.smtp.password">mailpassword</parameter>
        <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
</transportSender>

 You can use the mailtoWSO2 mail box by specifying the following in a synapse configuration:

Code Block
<endpoint>
     <address uri="mailtoWSO2:user@host"/>
</endpoint>

...