I am trying to configure mail setting with encryption method STARTTLS on port no 567.
How to set mail property props.put(“mail.smtp.ssl.trust”, “smtp.office365.com”);
No method available in ProcessEngineConfiguration
My Configuration
ProcessEngineConfiguration cfg = new StandaloneProcessEngineConfiguration()
.setMailServerHost(“smtp.office365.com”)
.setMailServerPort(567)
.setMailServerUsername(“username”)
.setMailServerPassword(“mypassword”)
.setMailServerUseTLS(true);
I am getting the following error
Caused by: org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.office365.com:587
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1469)
at org.apache.commons.mail.Email.send(Email.java:1496)
at org.flowable.engine.impl.bpmn.behavior.MailActivityBehavior.execute(MailActivityBehavior.java:102)
… 104 more
Caused by: javax.mail.MessagingException: Could not convert socket to TLS;
nested exception is:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:2155)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:752)