diff --git a/src/main/java/eu/dnetlib/uoaadmintoolslibrary/emailSender/EmailSender.java b/src/main/java/eu/dnetlib/uoaadmintoolslibrary/emailSender/EmailSender.java index 6d5e9a4..87d326b 100644 --- a/src/main/java/eu/dnetlib/uoaadmintoolslibrary/emailSender/EmailSender.java +++ b/src/main/java/eu/dnetlib/uoaadmintoolslibrary/emailSender/EmailSender.java @@ -30,6 +30,9 @@ public class EmailSender { properties.put("mail.smtp.port", mailConfig.getPort()); properties.put("mail.smtp.auth", mailConfig.getAuth()); //enable authentication properties.put("mail.smtp.starttls.enable", "true"); + if(mailConfig.getHost().equals("smtp.gmail.com")) { + properties.put("mail.smtp.ssl.protocols", "TLSv1.2"); + } logger.debug("Try to connect to mail sender with "+ mailConfig.getUsername()); Session session = Session.getInstance(properties, new javax.mail.Authenticator() {