Jul
25
|
JavaMail can be frustrating when it does not work, even worse when it works on one box but not on another. The following are t a few things to try and track down the cause of your problems.
Enable debug logging
This can be done in your code:
session.setDebug(true);
or on the command line:
java -Dmail.debug=true au.com.object.MyMailApp
Use telnet to test connections to mail servers (smtp, pop, imap)
This is useful for telling us if it’s a server or network problem. If telnet can connect ok, then so should your application. For example to test connection to a pop server
telnet mail.example.com 110
If you’re trying to connect to an SMTP server, use 25 instead of 110 for the port number. If you’re trying to connect to an IMAP server use 143 for the port number.
Let us know if you know any other techniques for debugging JavaMail problems.
Leave a Reply
You must be logged in to post a comment.