Skip to content

Commit a3f1d4c

Browse files
committed
modify default imap server on reading emails tutorial
1 parent 0a1850a commit a3f1d4c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

python-standard-library/reading-email-messages/reading_emails.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
# account credentials
88
username = "youremailaddress@provider.com"
99
password = "yourpassword"
10+
# use your email provider's IMAP server, you can look for your provider's IMAP server on Google
11+
# or check this page: https://www.systoolsgroup.com/imap/
12+
# for office 365, it's this:
13+
imap_server = "outlook.office365.com"
1014

1115

1216
def clean(text):
@@ -17,7 +21,7 @@ def clean(text):
1721
N = 3
1822

1923
# create an IMAP4 class with SSL, use your email provider's IMAP server
20-
imap = imaplib.IMAP4_SSL("imap.gmail.com")
24+
imap = imaplib.IMAP4_SSL(imap_server)
2125
# authenticate
2226
imap.login(username, password)
2327

0 commit comments

Comments
 (0)