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)

1  
lib 1400087 // gimap
2  
3  
import com.google.code.javax.mail.*;
4  
import com.google.code.javax.mail.internet.*;
5  
import com.google.code.com.sun.mail.imap.*;
6  
7  
static Folder googleCode_gmail_folder(S folderName) {
8  
  ret googleCode_gmail_folder(folderName, gmailDefaultUser());
9  
}
10  
11  
static Folder googleCode_gmail_folder(S folderName, S user) {
12  
  ret googleCode_gmail_folder(folderName, user, findGMailPassword(user));
13  
}
14  
  
15  
static Folder googleCode_gmail_folder(S folderName, S user, S pass) ctex {
16  
  new Properties props;
17  
  props.setProperty("mail.store.protocol", "imaps");
18  
19  
  Session session = Session.getInstance(props, null);
20  
  
21  
  URLName urlName = new URLName("imap.gmail.com");
22  
  IMAPSSLStore store = new IMAPSSLStore(session, urlName);
23  
  
24  
  store.connect("imap.gmail.com", user, pass);
25  
  
26  
  ret store.getFolder(folderName);
27  
}

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: 325 / 370
Version history: 4 change(s)
Referenced in: [show references]