Javamail and Gmail Pop3 SSL

后端 未结 2 1526
孤独总比滥情好
孤独总比滥情好 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:10

    The port should be 995 for gmail: http://support.google.com/mail/bin/answer.py?hl=en&answer=13287

    0 讨论(0)
  • 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`
    
    0 讨论(0)
提交回复
热议问题