Hi guys,
I m having problem with sending mail with POP3 server, the funny thing is when I try to run the same block of code via public static void main() it runs fine, but when it is ran through a batch flow throws error @
transport.connect(hostName, userName, password);
saying....
DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host "Smtp.mail.apac.microsoftonline.com", port 25, isSSL false
javax.mail.MessagingException: Could not connect to SMTP host: Smtp.mail.apac.microsoftonline.com, port: 25;
nested exception is:
java.net.ConnectException: Connection refused: connect
One more thing to notice here is even though I set POP3 port to ["mail.smtp.port", "587"] in the session properties, its using port number as 25,
and when I explicitly ask it to connect via port over 587
i.e
transport.connect(hostName, 587, userName, password);
it throws exception as...
DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host "Smtp.mail.apac.microsoftonline.com", port 587, isSSL false
220 smtp.mail.apac.microsoftonline.com Microsoft ESMTP MAIL Service ready at Tue, 14 Jun 2011 03:07:08 -0700
DEBUG SMTP: connected to host "Smtp.mail.apac.microsoftonline.com", port: 587
javax.mail.AuthenticationFailedException: No authentication mechansims supported by both server and client
I have no idea for what and why its causing so
Please help me out,
thanks and Regards
Mithun