0

I keep getting this Exception : javax.mail.MessagingException: Unrecognized SSL message, plaintext connection?

If i replace imaps with imap i get javax.mail.MessagingException: 220 *********** ESMTP MAIL Service ready at Tue, 16 Nov 2021 14:46:44 +0100;

    properties.setProperty("mail.imaps.host", host);
    properties.setProperty("mail.imaps.port", port);


    // SSL setting
    properties.setProperty("mail.imaps.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
    properties.setProperty("mail.imaps.socketFactory.fallback", "false");
    properties.setProperty("mail.imaps.socketFactory.port", String.valueOf(port));

    properties.setProperty("mail.imaps.starttls.enable", "true");
    properties.setProperty("mail.imaps.ssl.enable", "true");
    properties.setProperty("mail.imaps.ssl.trust", "*");
    properties.setProperty("mail.store.protocol", "imaps");
    // Debug
    properties.setProperty("mail.debug", "true");
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 25 '21 at 10:08
  • Is this configuration correct ? Why do i keep getting SMTP response (220 *********** ESMTP) whene i am actually tryin to conncet and read inbox ? – Bi.Yo.Son Nov 25 '21 at 13:45

0 Answers0