def main(email, password):
pop = POP3_SSL("pop.yandex.by")
pop.user(email)
pop.pass_(password)
response, lst, octets = pop.list()
print(response, lst, octets)
for msgnum, msgsize in [i.split() for i in lst]:
(resp, lines, octets) = pop.retr(msgnum)# Ошибка возникает тут
msgtext = "n".join(lines) + "nn"
message = email.message_from_string(msgtext)
print(message)
pop.dele(msgnum)
pop.quit()
b'+OK 1 19430' [b'1 19430'] 9
Traceback (most recent call last):
File "C:\Users\FFF\Desktop\kkk\main.py", line 89, in <module>
main(*data)
File "C:\Users\FFF\Desktop\kkk\main.py", line 79, in main
(resp, lines, octets) = pop.retr(msgnum)
File "C:\Users\FFF\AppData\Local\Programs\Python\Python36\lib\poplib.py", line 248, in retr
return self._longcmd('RETR %s' % which)
File "C:\Users\FFF\AppData\Local\Programs\Python\Python36\lib\poplib.py", line 183, in _longcmd
return self._getlongresp()
File "C:\Users\FFF\AppData\Local\Programs\Python\Python36\lib\poplib.py", line 159, in _getlongresp
resp = self._getresp()
File "C:\Users\FFF\AppData\Local\Programs\Python\Python36\lib\poplib.py", line 152, in _getresp
raise error_proto(resp)
poplib.error_proto: b'-ERR message does not exist or deleted. sc=XnamNVYWfOs1_102349_1-4aab5eef9bfd'
def main(email, password):
pop = POP3_SSL("pop.yandex.by")
pop.user(email)
pop.pass_(password)
response, lst, octets = pop.list()
print(response, lst, octets)
for msgnum, msgsize in [i.split() for i in lst]:
(resp, lines, octets) = pop.retr(int(msgnum))
msgtext = "n".join(lines) + "nn"#Нужно отлаживать, тут бред происходит
message = email.message_from_string(msgtext)# тут тоже
print(message)
pop.dele(int(msgnum))
pop.quit()