Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Properties props = System.getProperties();
- // Set manual Properties
- props.setProperty("mail.imaps.socketFactory.class", SSL_FACTORY);
- props.setProperty("mail.imaps.socketFactory.fallback", "false");
- props.setProperty("mail.imaps.port", "993");
- props.setProperty("mail.imaps.socketFactory.port", "993");
- props.put("mail.imaps.host", "outlook.office365.com");
- try {
- /* Create the session and get the store for read the mail. */
- Session session = Session.getDefaultInstance(System.getProperties(), null);
- Store store = session.getStore("imaps");
- store.connect("outlook.office365.com", 993, "eduardo.david@hpe.com/APSDataExtract", "-myPassword-");
- Exception while connecting to server: AUTHENTICATE failed.
- javax.mail.AuthenticationFailedException: AUTHENTICATE failed.
- at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:661)
- at javax.mail.Service.connect(Service.java:295)
- at t2.OutLookReader_imaps.<init>(OutLookReader_imaps.java:39)
- at t2.OutLookReader_imaps.main(OutLookReader_imaps.java:121)
- store.connect("outlook.office365.com", 993, "hpe\eduardo.david@hpe.com\APSDataExtract", "-myPassword-");
- Exception while connecting to server: * BYE Connection is closed. 13
- javax.mail.MessagingException: * BYE Connection is closed. 13;
- nested exception is:
- com.sun.mail.iap.ConnectionException: * BYE Connection is closed. 13
- at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:668)
- at javax.mail.Service.connect(Service.java:295)
- at t2.OutLookReader_imaps.<init>(OutLookReader_imaps.java:39)
- at t2.OutLookReader_imaps.main(OutLookReader_imaps.java:121)
- Caused by: com.sun.mail.iap.ConnectionException: * BYE Connection is closed. 13
- at com.sun.mail.iap.Protocol.handleResult(Protocol.java:356)
- at com.sun.mail.imap.protocol.IMAPProtocol.authplain(IMAPProtocol.java:603)
- at com.sun.mail.imap.IMAPStore.login(IMAPStore.java:736)
- at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:642)
- ... 3 more
- store.connect("outlook.office365.com", 993, "hpe\eduardo.david\APSDataExtract", "-myPassword-");
- Inside MailReader()...
- Exception while connecting to server: * BYE Connection is closed. 13
- javax.mail.MessagingException: * BYE Connection is closed. 13;
- nested exception is:
- com.sun.mail.iap.ConnectionException: * BYE Connection is closed. 13
- at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:668)
- at javax.mail.Service.connect(Service.java:295)
- at t2.OutLookReader_imaps.<init>(OutLookReader_imaps.java:39)
- at t2.OutLookReader_imaps.main(OutLookReader_imaps.java:121)
- Caused by: com.sun.mail.iap.ConnectionException: * BYE Connection is closed. 13
- at com.sun.mail.iap.Protocol.handleResult(Protocol.java:356)
- at com.sun.mail.imap.protocol.IMAPProtocol.authplain(IMAPProtocol.java:603)
- at com.sun.mail.imap.IMAPStore.login(IMAPStore.java:736)
- at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:642)
- store.connect("outlook.office365.com", 993, "hpe\davidedu\APSDataExtract", "-myPassword-");
- Inside MailReader()...
- Exception while connecting to server: * BYE Connection is closed. 13
- javax.mail.MessagingException: * BYE Connection is closed. 13;
- nested exception is:
- com.sun.mail.iap.ConnectionException: * BYE Connection is closed. 13
- at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:668)
- at javax.mail.Service.connect(Service.java:295)
- at t2.OutLookReader_imaps.<init>(OutLookReader_imaps.java:39)
- at t2.OutLookReader_imaps.main(OutLookReader_imaps.java:121)
- Caused by: com.sun.mail.iap.ConnectionException: * BYE Connection is closed. 13
- at com.sun.mail.iap.Protocol.handleResult(Protocol.java:356)
- at com.sun.mail.imap.protocol.IMAPProtocol.authplain(IMAPProtocol.java:603)
- at com.sun.mail.imap.IMAPStore.login(IMAPStore.java:736)
- at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:642)
- ... 3 more
- store.connect("outlook.office365.com", 993, "eduardo.david@hpe.com", "-myPassword-");
Add Comment
Please, Sign In to add comment