member:discord.Member
Traceback (most recent call last):
File "C:\Users\UkaUkaa\Desktopmail.py", line 179, in <module>
word_static(LastSubject)
File "C:\Users\UkaUkaa\Desktopmail.py", line 156, in word_static
mail = codecs.decode("UTF-8", list_data[1])
LookupError: unknown encoding:
\u0417\u0430\u043a\u0430\u0437......
def ReadingMail():
mail = imaplib.IMAP4_SSL('imap.gmail.com')
mail.login(settings.LOGIN, settings.PASSWORD)
mail.list()
mail.select("inbox")
result, data = mail.search(None, "ALL")
ids = data[0]
id_list = ids.split()
latest_email_id = id_list[-1]
result, data = mail.fetch(latest_email_id, "(RFC822)")
raw_email = data[0][1]
raw_email_string = raw_email.decode()
email_message = email.message_from_string(raw_email_string, policy=policy.default)
if email_message.is_multipart():
for payload in email_message.get_payload():
body = payload.get_payload(decode=True).decode('UTF-8')
#print(body)
else:
body = email_message.get_payload(decode=True).decode('UTF-8')
#print(body)
list_data = [email_message['Subject'], body]
return list_data
<Response [400]>
Вот какой headers передаю