# Unable to send mail with tls port 567

**URL:** <https://forum.flowable.org/t/unable-to-send-mail-with-tls-port-567/4310>\
**Category:** Flowable Application\
**Created:** [August 5, 2019, 1:26pm UTC](https://forum.flowable.org/t/unable-to-send-mail-with-tls-port-567/4310 "2019-08-05T13:26:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![infinitysiddhu](https://avatars.discourse-cdn.com/v4/letter/i/73ab20/32.png) [@infinitysiddhu](https://forum.flowable.org/u/infinitysiddhu)\
**Post date:** [August 5, 2019, 1:26pm UTC](https://forum.flowable.org/t/unable-to-send-mail-with-tls-port-567/4310/1 "2019-08-05T13:26:02Z")

</div>

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](http://smtp.office365.com)”);  
No method available in ProcessEngineConfiguration  
My Configuration  
ProcessEngineConfiguration cfg = new StandaloneProcessEngineConfiguration()  
.setMailServerHost(“[smtp.office365.com](http://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](http://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)

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [August 7, 2019, 9:14am UTC](https://forum.flowable.org/t/unable-to-send-mail-with-tls-port-567/4310/2 "2019-08-07T09:14:47Z")

</div>

Not sure, that looks ok. Are you sure TLS is used and not ssl?

---

<div class="post-metadata">

**Author:** ![santosh](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@santosh](https://forum.flowable.org/u/santosh)\
**Post date:** [October 30, 2019, 10:07am UTC](https://forum.flowable.org/t/unable-to-send-mail-with-tls-port-567/4310/3 "2019-10-30T10:07:47Z")

</div>

Hi,  
try using beow properties.

flowable.mail.server.use-tls=true

flowable.mail.server.use-ssl=true

[flowable.mail.server.host=smtp.gmail.com](http://flowable.mail.server.host=smtp.gmail.com)

flowable.mail.server.port=587

[flowable.mail.server.username=abc@gmail.com](mailto:flowable.mail.server.username=abc@gmail.com)

flowable.mail.server.password=Gmail Account App password

-Santosh
