Exception in thread "main" java.lang.RuntimeException: javax.mail.MessagingException: [EOF]
Caused by: javax.mail.MessagingException: [EOF]
What you posted there looks more or less like the sample code I've seen elsewhere for using Gmail to send messages. I haven't examined it in detail, though. The only problem I see is, I wouldn't expect to be able to use Gmail to send messages from some other domain (like abcd.com). I would expect the authentication to fail, for one thing.
However the error message you posted isn't quite what I would expect. It looks more like you can't make a connection to Gmail's SMTP server, maybe.
posted 4 years ago
the same code is working fine for other servers, i can telnet to localport 25 as well as 587, the problem is with only one server. Thanks in advance
I just ran the code and it not worked as expected.
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: "myhost", port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect