没有密码时我无法访问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);