2
votes

I am trying to send an e-mail to a specific address using WSO2 ESB.

I configured my axis2.xml by applying following settings to mailto transport sender.

<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">[email protected]</parameter>
        <parameter name="mail.smtp.password">mypassword</parameter>
        <parameter name="mail.smtp.from">[email protected]</parameter>
    </transportSender>

This is my fragment of the sequence which is responsible for sending mail.

  <log level="custom">
      <property name="Mail status" value="===============enter the mail============="/>
   </log>
   <property name="messageType" value="text/html" scope="axis2"/>
   <property name="ContentType" value="text/html" scope="axis2"/>
   <property name="Subject" value="File Received" scope="transport"/>
   <property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
   <log level="full"/>
   <send>
      <endpoint>
         <address uri="mailto:[email protected]"/>
      </endpoint>
   </send>
   <log level="custom">
      <property name="flag" value="=====After======="/>
   </log>

I am pretty much sure that other parts of my proxy service are working just fine. But the problem is when I triggered the proxy service, it is going through all parts of the sequence without throwing an error but not sending the mail

This is my console output relevant to the fragment of sequence I stated earlier.

[2013-01-29 17:07:15,552]  INFO - LogMediator Mail status = ===============enter
 the mail=============
[2013-01-29 17:07:15,552]  INFO - LogMediator To: , WSAction: urn:mediate, SOAPA
ction: urn:mediate, MessageID: urn:uuid:a12fd64c-f5c5-4b22-b092-e15af960a3d2, Di
rection: request, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envel
ope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body>
                <geo:getZipCode xmlns:geo="http://geo.wso2">
            <geo:longitude>1</geo:longitude>
            <geo:latitude>3</geo:latitude>
         </geo:getZipCode>
            </soapenv:Body></soapenv:Envelope>
[2013-01-29 17:07:15,567]  INFO - LogMediator flag = =====After=======

Guys please any one knows what's the issue is????

2
Guys I found out what is the problem. It was my network admins who bolcking the port 587 nothing wrong in configuration It just works perfectly many thanks for your considerations also very sorryDimuthu

2 Answers

0
votes

Try to use

<parameter name="mail.smtp.user">myusername</parameter> 

without @gmail.com

0
votes

For those of you who are trying to send an email using the configuration stated in the question via wso2 esb, apart from all that you will need to include a axis2-transport-mail-1.0.0.jar under wso2esb-5.0.0\repository\axis2\client\lib. This jar contains the classes necessary for axis2 to send out an email. Hope this helps someone.