Javamail and Gmail Pop3 SSL

后端 未结 2 1527
孤独总比滥情好
孤独总比滥情好 2021-01-13 17:20

i\'m trying to connect my app to Gmail to check emails. I must use SSL for POP3.

This is my code:

    Properties props = new Properties();

    props         


        
2条回答
  •  一向
    一向 (楼主)
    2021-01-13 18:15

    I think it will help you

     Properties properties = new Properties();  
     properties.put("mail.pop3.host", pop3Host);
     properties.put("mail.pop3.ssl.enable", true);
     properties.put("mail.pop3.ssl.trust", "*");
     properties.put("mail.pop3.port", 995);
     Session emailSession = Session.getDefaultInstance(properties); `enter code here`
    

提交回复
热议问题