Tag: 的Gmail的IMAP

无法在Android上使用XOAUTH连接到Gmail IMAP

我正在构建一个使用Gmail备份某些数据的应用。 我使用XOAUTH连接到Gmail并获得令牌和秘密。 但我无法连接到Gmail的IMAP服务。 我按照http://code.google.com/p/google-mail-xoauth-tools/wiki/JavaSampleCode上的示例进行了操作: Properties props = new Properties(); props.put(“mail.imaps.sasl.enable”, “true”); props.put(“mail.imaps.sasl.mechanisms”, “XOAUTH”); props.put(OAUTH_TOKEN_PROP, oauthToken); props.put(OAUTH_TOKEN_SECRET_PROP, oauthTokenSecret); props.put(CONSUMER_KEY_PROP, Const.CONSUMER_KEY); props.put(CONSUMER_SECRET_PROP, Const.CONSUMER_SECRET); Session session = Session.getInstance(props); session.setDebug(debug); final URLName unusedUrlName = null; IMAPSSLStore store = new IMAPSSLStore(session, unusedUrlName); final String emptyPassword = “”; store.connect(host, port, userEmail, emptyPassword); return store; 运行时,它会报告以下exception。 javax.mail.MessagingException: * BYE [UNAVAILABLE] Temporary System […]