Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

27
LINES

< > BotCompany Repo | #1016626 // googleCode_gmailDefaultFolder

JavaX fragment (include)

lib 1400087 // gimap

import com.google.code.javax.mail.*;
import com.google.code.javax.mail.internet.*;
import com.google.code.com.sun.mail.imap.*;

static Folder googleCode_gmailDefaultFolder() {
  ret googleCode_gmailDefaultFolder(gmailDefaultUser());
}

static Folder googleCode_gmailDefaultFolder(S user) {
  ret googleCode_gmailDefaultFolder(user, findGMailPassword(user));
}
  
static Folder googleCode_gmailDefaultFolder(S user, S pass) ctex {
  new Properties props;
  props.setProperty("mail.store.protocol", "imaps");

  Session session = Session.getInstance(props, null);
  
  URLName urlName = new URLName("imap.gmail.com");
  IMAPSSLStore store = new IMAPSSLStore(session, urlName);
  
  store.connect("imap.gmail.com", user, pass);
  
  ret store.getDefaultFolder();
}

Author comment

Began life as a copy of #1003301

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016626
Snippet name: googleCode_gmailDefaultFolder
Eternal ID of this version: #1016626/8
Text MD5: 53db1a6ca9ff3d358b993325d2038e2b
Author: stefan
Category: javax / networking
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-25 21:52:11
Source code size: 809 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 399 / 472
Version history: 7 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1016633 - googleCode_gmail_folder