I am trying to sent an email using my company\'s mail server. But I am getting the following exception
Caused by: com.sun.mail.smtp.SMTPSendFailedException:
I had to use javamail + exchange. The messages returned were helpless. Thanks to the stack, I got some hints.
Add this to your code
props.put("mail.smtp.starttls.enable","true");
Think of adding the certificates of the machines used too. To find them, just go to your browser, export them and import to the cacerts file in use.