Java How to Trust all Email Server

1. Use this to trust all the Email Server,
then we no need to get the server cer file and add into the cacerts
System.setProperty(“mail.smtp.ssl.trust”, “*”);

Source: https://www.programcreek.com/java-api-examples/?class=org.apache.commons.mail.Email&method=setStartTLSEnabled

Add Comment