-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathread_mail_items.py
41 lines (29 loc) · 1.36 KB
/
read_mail_items.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
""" from exchangelib import Credentials, Account, DELEGATE
import sys
username = '[email protected]'
password = 'tech121login*'
credentials = Credentials(username, password)
account = Account('[email protected]', credentials=credentials, autodiscover=True,
access_type=DELEGATE)
for item in account.inbox.all().order_by('-datetime_received')[:100]:
print(item.subject, item.sender, item.datetime_received)
sys.exit("I am getting the heck out of here!") """
from exchangelib import DELEGATE, IMPERSONATION, Account, Credentials, ServiceAccount, \
EWSDateTime, EWSTimeZone, Configuration, NTLM, CalendarItem, Message, \
Mailbox, Attendee, Q, ExtendedProperty, FileAttachment, ItemAttachment, \
HTMLBody, Build, Version
from exchangelib.protocol import BaseProtocol, NoVerifyHTTPAdapter
BaseProtocol.HTTP_ADAPTER_CLS = NoVerifyHTTPAdapter
import sys
creds = Credentials(
username="ex.gasf.com\\Administrator",
password="tech121login*")
config = Configuration(server='ex.gasf.com', credentials=creds)
account = Account(
primary_smtp_address="[email protected]",
autodiscover=False,
config = config,
access_type=DELEGATE)
for item in account.inbox.all().order_by('-datetime_received')[:100]:
print(item.subject, item.sender, item.datetime_received)
sys.exit("I am getting the heck out of here!")