i developed a small java application for sending mails to list of email id's.
if configured the properties by giving property 1.mail.host=(mailserver address) 2.mail.debug=true
in stanalone application,it work fine and the mails were send to the list of mails id by giving the message in debug mode.
Connected to host: 10.45.26.62, port: 25;
but, when i integrated the same application in web container (tomcat and sun application server) its giving the following error.
javax.mail.MessagingException: Could not connect to SMTP host: 10.45.26.62, port: 25; nested exception is: java.net.SocketException: Software caused connection abort: 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)
Because the software on your web application server couldn't connect to the SMTP server, just as the message says. It isn't a given that any computer in the world can automatically connect to any other computer in the world, instead we have networks and firewalls and proxies and virus scanners that control who can connect to what.
So first check out your basic network connection. Go to a command line (on the same machine as the app server!) and type
This tells you if your machine can physically connect to the machine where the SMTP server is running. Next type
TELNET 10.45.26.62 25
This tells you if your machine can connect to the SMTP server itself. If either of them fail (as I guess they will), talk to your network administrator to find out why.
So that could mean there is no SMTP server running on 10.45.26.62. Or (unlikely) that the SMTP server there is listening on some other port. Or that some router or firewall or virus-checker is preventing access to that port. The people who configured the network should be able to explain to you what is going on.