Exception while Sending mail

Hi,

When I ried to send email via java by the parameters properly, I hav the following exception.

Could not connect to SMTP host: localhost, port: 25;

nested exception is:

java.net.ConnectException: Connection refused: connect

javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;

nested exception is:

java.net.ConnectException: Connection refused: connect

at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1213)

at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:311)

at javax.mail.Service.connect(Service.java:233)

at javax.mail.Service.connect(Service.java:134)

at javax.mail.Service.connect(Service.java:86)

at com.sun.mail.smtp.SMTPTransport.connect(SMTPTransport.java:144)

at javax.mail.Transport.send0(Transport.java:150)

at javax.mail.Transport.send(Transport.java:80)

at com.quotemeright.email.Email.send(Email.java:142)

at com.quotemeright.event.RegistrationEvent.doRegisterUser(RegistrationEvent.java:1095)

at com.quotemeright.event.RegistrationEvent.doIt(RegistrationEvent.java:69)

at com.quotemeright.control.ControlServlet.service(ControlServlet.java:329)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)

at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)

at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

at java.lang.Thread.run(Thread.java:595)

Can anybody giv a solution to this problem?

Thanks,

Sreejith

[2994 byte] By [JavaXchangesa] at [2007-11-26 14:55:59]
# 1

Do you have an SMTP server running on the same

machine that you're running your JavaMail application on?

It appears not.

Most likely you want to connect to an SMTP server on

another machine, but you haven't configured JavaMail

properly to do that. See the JavaMail FAQ and the many

example programs included with JavaMail.

bshannona at 2007-7-8 8:44:32 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Nowadays most of the mailservers doesn't work on port 25. Find the correct port number being used by the mailserver and try connecting using it....
Vigitha at 2007-7-8 8:44:32 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...