Hi Am working with WSO2 ESB 4.7.0,

Am trying to send a Email by using WSO2 ESB,For this i have uncommented the following line in Axis2.xml file,

```
<transportSender name=”mailto”>
<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”>password</parameter>
<parameter name=”mail.smtp.from”>Sender@gmail.com</parameter>
</transportSender>
<transportReceiver name=”mailto”>

```

And i have created a Proxy in esb. 

```
<proxy xmlns="http://ws.apache.org/ns/synapse"
   name="mailtoproxy"
   transports="https,http"
   statistics="disable"
   trace="disable"
   startOnLoad="true">
 <target>
  <inSequence>
              <payloadFactory media-type="xml">
        <format>
           <format xmlns="">
              <sendMailResponse>$1</sendMailResponse>
           </format>
        </format>
        <args>
           <arg value="Message Sent from the WSO2 ESB"/>
        </args>
     </payloadFactory>
     <property name="transport.mail.Format"
               value="Attachment"
               scope="axis2"
               type="STRING"/>
     <property name="AttachmentFile"
               value="Attachment.csv"
               scope="axis2"
               type="STRING"/>
     <property name="Subject"
               value="File Received"
               scope="transport"
               type="STRING"/>
<property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
     <log level="full"/>
     <send>
        <endpoint>
           <address uri="mailto:receiver@gmail.com"/>
        </endpoint>
     </send>
  </inSequence>
  <outSequence>
     <send/>
  </outSequence>
  </target>
  <description/>
   </proxy>

```

When i send a request to this service this should send a mail to the receiver@gmail.com but its showing an error in my ESB Server as shown below

```
  [2015-03-16 13:12:14,305] ERROR - Axis2Sender Unexpected error during sending message out
org.apache.axis2.AxisFault: Error generating mail message
at org.apache.axis2.transport.base.AbstractTransportSender.handleException(AbstractTransportSender.java:226)
at org.apache.axis2.transport.mail.MailTransportSender.sendMessage(MailTransportSender.java:184)
at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:297)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:481)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:57)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:342)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:329)
at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:59)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:95)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:162)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:337)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:378)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:184)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:701)
  Caused by: org.apache.axis2.AxisFault: Error creating mail message or sending it to the configured server
at org.apache.axis2.transport.base.AbstractTransportSender.handleException(AbstractTransportSender.java:226)
at org.apache.axis2.transport.mail.MailTransportSender.sendMail(MailTransportSender.java:500)
at org.apache.axis2.transport.mail.MailTransportSender.sendMessage(MailTransportSender.java:175)
... 21 more
  Caused by: javax.mail.AuthenticationFailedException
at javax.mail.Service.connect(Service.java:306)
at javax.mail.Service.connect(Service.java:156)
at javax.mail.Service.connect(Service.java:105)
at javax.mail.Transport.send0(Transport.java:168)
at javax.mail.Transport.send(Transport.java:98)
at org.apache.axis2.transport.mail.MailTransportSender.sendMail(MailTransportSender.java:489)
... 22 more
[2015-03-16 13:12:14,307]  WARN - EndpointContext Endpoint : endpoint_c18765aff47545c8778c221c4d89739409dd4a3401d36fcc will be marked SUSPENDED as it failed
[2015-03-16 13:12:14,307]  WARN - EndpointContext Suspending endpoint : endpoint_c18765aff47545c8778c221c4d89739409dd4a3401d36fcc - last suspend duration was : 30000ms and current suspend duration 

```

Please help me out how to overcome this Error.