使用密码访问JAVAMAIL

时间:2018-04-13 11:28:54

标签: automation javamail pop3

没有密码时我无法访问java邮件。 但是,当我提供正确的用户名和密码时,我可以访问java邮件。

以下是我的代码:

Properties properties = new Properties();
   properties.put("mail.pop3.host", host);
   properties.put("mail.pop3.port", "995");
   properties.put("mail.pop3.starttls.enable", "true");
Session emailSession = Session.getDefaultInstance(properties);
Store store = emailSession.getStore("pop3s");
      store.connect(host, user, password);

0 个答案:

没有答案