new-features #5
1 changed files with 33 additions and 0 deletions
33
prototyping/email_stuff.py
Normal file
33
prototyping/email_stuff.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# %%
|
||||
|
||||
import base64
|
||||
import email
|
||||
import imaplib
|
||||
|
||||
# %%
|
||||
import json
|
||||
from imaplib import IMAP4, IMAP4_SSL
|
||||
from pathlib import Path
|
||||
|
||||
# -------------------------------- credentials ------------------------------- #
|
||||
|
||||
cred_file = Path("../credentials.json")
|
||||
with open(cred_file, "r") as f:
|
||||
CREDENTIALS = json.load(f)
|
||||
|
||||
username = CREDENTIALS["imap_user"]
|
||||
password = CREDENTIALS["imap_pass"]
|
||||
|
||||
|
||||
# ----------------------------------- imap ----------------------------------- #
|
||||
|
||||
host = "mail.local-it.org"
|
||||
imap_port = 143
|
||||
imap_ssl_port = 993
|
||||
|
||||
|
||||
# with IMAP4("domain.org") as M:
|
||||
# M.noop()
|
||||
|
||||
with IMAP4_SSL(host=host) as M:
|
||||
M.noop()
|
||||
Loading…
Add table
Add a link
Reference in a new issue