Hello,
I see this is working for some. What other Properties did you need to set? I am still receiving the following exception
Exception in thread "main" com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;
nested exception is:
java.net.ConnectException: Connection refused: connect
Here the Properties I am using
Properties props;
props = new Properties();
props.put("smtp.office365.com", "587");
props.put("mail.smtp.auth", true);
props.put("mail.smtp.starttls.enable", true);
props.setProperty("mail.smtp.ssl.protocols", "TLSv1.2");
Any feedback would be appreciated and helpful. Thanks!