Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit272ee58

Browse files
committed
fix some issues regarding reading emails with gmail api
1 parent4960ff8 commit272ee58

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎general/gmail-api/read_emails.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ def read_message(service, message_id):
9494
forheaderinheaders:
9595
name=header.get("name")
9696
value=header.get("value")
97-
ifname=='From':
97+
ifname.lower()=='from':
9898
# we print the From address
9999
print("From:",value)
100-
ifname=="To":
100+
ifname.lower()=="to":
101101
# we print the To address
102102
print("To:",value)
103-
ifname=="Subject":
103+
ifname.lower()=="subject":
104104
# make a directory with the name of the subject
105105
folder_name=clean(value)
106106
# we will also handle emails with the same subject name
@@ -116,7 +116,7 @@ def read_message(service, message_id):
116116
folder_name=f"{folder_name}_{folder_counter}"
117117
os.mkdir(folder_name)
118118
print("Subject:",value)
119-
ifname=="Date":
119+
ifname.lower()=="date":
120120
# we print the date when the message was sent
121121
print("Date:",value)
122122

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp