Hi All, I am trying to write a simple Java application to send a mail using java mail api. I want to use my computer as an smtp host.
The code is as under :
I am getting the following exception :
javax.mail.MessagingException: Exception reading response; nested exception is: java.net.SocketException: Connection reset at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1611) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1369) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412) at javax.mail.Service.connect(Service.java:288) at javax.mail.Service.connect(Service.java:169) at javax.mail.Service.connect(Service.java:118) at javax.mail.Transport.send0(Transport.java:188) at javax.mail.Transport.send(Transport.java:118) at com.javamail.example.SMTPClient$SendAction$1.run(SMTPClient.java:102) at java.lang.Thread.run(Thread.java:595) Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:110) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:88) at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1589) ... 9 more
Please help me as i am unable to solve the problem. Thanks in advance.
When you use JavaMail to send an e-mail, and you don't get any exceptions but the e-mail doesn't arrive, the next step is to ask the administrator of the SMTP server to investigate.
In this case, that administrator is you. You will have to see what logging James does. It's quite possible you have configured it incorrectly. It might not have a connection to the Internet, or you might have set it up in such a way that other servers won't talk to it. Anything is possible. I recall that it comes with how-to documentation but it's a few years since I looked at it.
If you don't want to become an administrator, perhaps you should find another server you can use. Then you can ask its administrator to deal with this sort of problem.
Joined: Feb 23, 2007
Hi, I am connected to the internet when I run my mail program. When I setup the account with Mozilla Thunderbird then its working and I am able to send and receive mails. One important thing when I am trying to send mail to my gmail account or yahoo account using Thunderbird then also the mail dosen't go. Why is this happening ?. But I am not able to do the same thing using my SMTP client program. I am not able to understand where I am going wrong.
Joined: Feb 23, 2007
Hi All, Following is the log which I am getting in apache james mail server.
Please Help me and guide me where I am going wrong. Thanks in advance.