[mule-dev] SMTP

63 views
Skip to first unread message

sandiya ujwala

unread,
Apr 7, 2011, 8:15:31 AM4/7/11
to d...@mule.codehaus.org
Hi,
Iam reading a file and trying to send it to my mail using SMTP....
My program is deploying successfully but when iam keeping the file in the input folder then the error shown below is coming can anyone plz help me......

INFO 2011-04-07 17:38:56,246 [[swathi].connector.file.0.receiver.1] org.mule.transport.file.FileMessageReceiver: Lock obtained on file: D:\mule-standalone-3.2.0-SNAPSHOT\bin\rama\New Text Document.t
t
WARN 2011-04-07 17:38:56,246 [[swathi].seda.smtpService.2] org.mule.context.notification.Configuration: The notification listener subscription "ListenerSubscriptionPair [listener=StringToEmailMessag
{this=1e6cecc, name='StringToMessage', ignoreBadInput=false, returnClass=SimpleDataType{type=javax.mail.Message, mimeType='*/*'}, sourceTypes=[SimpleDataType{type=java.lang.String, mimeType='*/*'}]},
subscription=NULL]" has already been registered
INFO 2011-04-07 17:38:56,246 [[swathi].connector.smtp.0.dispatcher.1] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default outbound transformer: org.mule.transport.email.tra
sformers.ObjectToMimeMessage
INFO 2011-04-07 17:38:56,246 [[swathi].connector.smtp.0.dispatcher.1] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'connector.smtp.0.dispatcher.17552369'. Object is: SmtpMessageDispatc
er
ERROR 2011-04-07 17:38:56,261 [[swathi].connector.smtp.0.dispatcher.1] org.mule.retry.notifiers.ConnectNotifier: Failed to connect/reconnect: endpoint.outbound.smtp://smtp.gmail.com:25. Root Exceptio
was: Connection refused: connect. Type: class java.net.ConnectException
ERROR 2011-04-07 17:38:56,261 [[swathi].connector.smtp.0.dispatcher.1] org.mule.exception.DefaultServiceExceptionStrategy:
********************************************************************************
Message : Unable to connect to mail transport.
Code : MULE_ERROR-59999
--------------------------------------------------------------------------------
Exception stack is:
1. Connection refused: connect (java.net.ConnectException)
java.net.PlainSocketImpl:-2 (null)
2. Could not connect to SMTP host: smtp.gmail.com, port: 25 (javax.mail.MessagingException)
com.sun.mail.smtp.SMTPTransport:1706 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/mail/MessagingException.html)
3. Unable to connect to mail transport. (org.mule.api.endpoint.EndpointException)
org.mule.transport.email.SmtpMessageDispatcher:71 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/endpoint/EndpointException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************


THIS IS MY SOURCE CODE

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ftp="http://www.mulesoft.org/schema/mule/ftp" xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:jbossts="http://www.mulesoft.org/schema/mule/jbossts" xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:smtp= "http://www.mulesoft.org/schema/mule/smtp"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
xmlns:ws="http://www.mulesoft.org/schema/mule/ws"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/smtp http://www.mulesoft.org/schema/mule/smtp/3.1/mule-smtp.xsd
http://www.mulesoft.org/schema/mule/ftp http://www.mulesoft.org/schema/mule/ftp/3.2/mule-ftp.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.2/mule-file.xsd
http://www.mulesoft.org/schema/mule/jbossts http://www.mulesoft.org/schema/mule/jbossts/3.2/mule-jbossts.xsd
http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/3.2/mule-jdbc.xsd
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/3.2/mule-jms.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd
http://www.mulesoft.org/schema/mule/ws http://www.mulesoft.org/schema/mule/ws/3.2/mule-ws.xsd">
<smtp:gmail-connector name="emailConnector" />
<model name="processInboundFileModel">
<service name="processInboundFileService">
<inbound>
<file:inbound-endpoint path="./demo">
<file:file-to-string-transformer/>
</file:inbound-endpoint>
</inbound>

<outbound>
<pass-through-router>
<smtp:outbound-endpoint host="smtp.gmail.com" port="587" from="********@gmail.com" password="*********"
to="********@gmail.com" subject="Please verify your account details"/>
</pass-through-router>

</outbound>
</service>
</model>
</mule>

Thanks in advance,
Sandhya....

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Dirk Olmes

unread,
Apr 7, 2011, 9:01:30 AM4/7/11
to d...@mule.codehaus.org
On 04/07/2011 05:15 AM, sandiya ujwala wrote:
> Hi, Iam reading a file and trying to send it to my mail using
> SMTP.... My program is deploying successfully but when iam keeping
> the file in the input folder then the error shown below is coming can
> anyone plz help me......

Well ...

> Root Exception stack trace: java.net.ConnectException: Connection
> refused: connect at java.net.PlainSocketImpl.socketConnect(Native
> Method) at
> java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) +
> 3 more (set debug level logging or '-Dmule.verbose.exceptions=true'
> for everything)

The exception says it all - cannot connect to google. Are you behind a
firewall? Is the port open?

-dirk

Reply all
Reply to author
Forward
0 new messages