Guest User

Untitled

a guest
Dec 7th, 2017
1,153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. Properties props = System.getProperties();
  2. // Set manual Properties
  3. props.setProperty("mail.imaps.socketFactory.class", SSL_FACTORY);
  4. props.setProperty("mail.imaps.socketFactory.fallback", "false");
  5. props.setProperty("mail.imaps.port", "993");
  6. props.setProperty("mail.imaps.socketFactory.port", "993");
  7. props.put("mail.imaps.host", "outlook.office365.com");
  8.  
  9.  
  10.  
  11. try {
  12. /* Create the session and get the store for read the mail. */
  13.  
  14. Session session = Session.getDefaultInstance(System.getProperties(), null);
  15. Store store = session.getStore("imaps");
  16.  
  17. store.connect("outlook.office365.com", 993, "eduardo.david@hpe.com/APSDataExtract", "-myPassword-");
  18.  
  19. Exception while connecting to server: AUTHENTICATE failed.
  20. javax.mail.AuthenticationFailedException: AUTHENTICATE failed.
  21. at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:661)
  22. at javax.mail.Service.connect(Service.java:295)
  23. at t2.OutLookReader_imaps.<init>(OutLookReader_imaps.java:39)
  24. at t2.OutLookReader_imaps.main(OutLookReader_imaps.java:121)
  25.  
  26. store.connect("outlook.office365.com", 993, "hpe\eduardo.david@hpe.com\APSDataExtract", "-myPassword-");
  27.  
  28. Exception while connecting to server: * BYE Connection is closed. 13
  29. javax.mail.MessagingException: * BYE Connection is closed. 13;
  30. nested exception is:
  31. com.sun.mail.iap.ConnectionException: * BYE Connection is closed. 13
  32. at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:668)
  33. at javax.mail.Service.connect(Service.java:295)
  34. at t2.OutLookReader_imaps.<init>(OutLookReader_imaps.java:39)
  35. at t2.OutLookReader_imaps.main(OutLookReader_imaps.java:121)
  36. Caused by: com.sun.mail.iap.ConnectionException: * BYE Connection is closed. 13
  37. at com.sun.mail.iap.Protocol.handleResult(Protocol.java:356)
  38. at com.sun.mail.imap.protocol.IMAPProtocol.authplain(IMAPProtocol.java:603)
  39. at com.sun.mail.imap.IMAPStore.login(IMAPStore.java:736)
  40. at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:642)
  41. ... 3 more
  42.  
  43. store.connect("outlook.office365.com", 993, "hpe\eduardo.david\APSDataExtract", "-myPassword-");
  44.  
  45. Inside MailReader()...
  46. Exception while connecting to server: * BYE Connection is closed. 13
  47. javax.mail.MessagingException: * BYE Connection is closed. 13;
  48. nested exception is:
  49. com.sun.mail.iap.ConnectionException: * BYE Connection is closed. 13
  50. at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:668)
  51. at javax.mail.Service.connect(Service.java:295)
  52. at t2.OutLookReader_imaps.<init>(OutLookReader_imaps.java:39)
  53. at t2.OutLookReader_imaps.main(OutLookReader_imaps.java:121)
  54. Caused by: com.sun.mail.iap.ConnectionException: * BYE Connection is closed. 13
  55. at com.sun.mail.iap.Protocol.handleResult(Protocol.java:356)
  56. at com.sun.mail.imap.protocol.IMAPProtocol.authplain(IMAPProtocol.java:603)
  57. at com.sun.mail.imap.IMAPStore.login(IMAPStore.java:736)
  58. at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:642)
  59.  
  60. store.connect("outlook.office365.com", 993, "hpe\davidedu\APSDataExtract", "-myPassword-");
  61.  
  62. Inside MailReader()...
  63. Exception while connecting to server: * BYE Connection is closed. 13
  64. javax.mail.MessagingException: * BYE Connection is closed. 13;
  65. nested exception is:
  66. com.sun.mail.iap.ConnectionException: * BYE Connection is closed. 13
  67. at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:668)
  68. at javax.mail.Service.connect(Service.java:295)
  69. at t2.OutLookReader_imaps.<init>(OutLookReader_imaps.java:39)
  70. at t2.OutLookReader_imaps.main(OutLookReader_imaps.java:121)
  71. Caused by: com.sun.mail.iap.ConnectionException: * BYE Connection is closed. 13
  72. at com.sun.mail.iap.Protocol.handleResult(Protocol.java:356)
  73. at com.sun.mail.imap.protocol.IMAPProtocol.authplain(IMAPProtocol.java:603)
  74. at com.sun.mail.imap.IMAPStore.login(IMAPStore.java:736)
  75. at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:642)
  76. ... 3 more
  77.  
  78. store.connect("outlook.office365.com", 993, "eduardo.david@hpe.com", "-myPassword-");
Add Comment
Please, Sign In to add comment