- Uncomment below line in <ESB_HOME>/repository/conf/axis2/axis2.xml/axis2.xml to enable Email transport listener.
<transportReceiver name="mailto" class="org.apache.axis2.transport.mail.MailTransportListener">
- Restart WSO2 ESB if has already started.
- Log in to Management console and add below proxy.
Here, proxy transport type is mailto. The mailto transport supports sending messages (E-Mail) over SMTP and receiving messages over POP3 or IMAP.
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="EmailReciever"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="mailto">
<target>
<inSequence>
<log level="custom">
<property expression="$trp:Subject" name="Subject"/>
</log>
<drop/>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<parameter name="transport.PollInterval">5</parameter>
<parameter name="mail.pop3.host">pop.gmail.com</parameter>
<parameter name="mail.pop3.password">wso2pass</parameter>
<parameter name="mail.pop3.user">wso2user</parameter>
<parameter name="mail.pop3.socketFactory.port">995</parameter>
<parameter name="transport.mail.ContentType">text/plain</parameter>
<parameter name="mail.pop3.port">995</parameter>
<parameter name="mail.pop3.socketFactory.fallback">false</parameter>
<parameter name="transport.mail.Address">wso2user@gmail.com</parameter>
<parameter name="transport.mail.Protocol">pop3</parameter>
<parameter name="mail.pop3.socketFactory.class">javax.net.ssl.SSLSocketFactory</parameter>
<description/>
</proxy>
- Send email to wso2user@gmail.com. You can see the email recieving to ESB from the logs.
Note : If you are using gmail to receive emails, you have to allow external apps access in your google account as mention in
here.
No comments:
Post a Comment