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

27
LINES

< > BotCompany Repo | #1016633 // googleCode_gmail_folder

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_gmail_folder(S folderName) {
  ret googleCode_gmail_folder(folderName, gmailDefaultUser());
}

static Folder googleCode_gmail_folder(S folderName, S user) {
  ret googleCode_gmail_folder(folderName, user, findGMailPassword(user));
}
  
static Folder googleCode_gmail_folder(S folderName, 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.getFolder(folderName);
}

Author comment

Began life as a copy of #1016626

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: #1016633
Snippet name: googleCode_gmail_folder
Eternal ID of this version: #1016633/5
Text MD5: ad1fbd4a518988575095e70497dc3ebd
Author: stefan
Category: javax / networking
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-26 00:28:16
Source code size: 846 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 324 / 369
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)