admin管理员组文章数量:1122846
I want to create a basic script that can automatically sort all my emails (I use Outlook) into different folders. So let's say I got an email that came from [email protected]
, the script will create a folder called "company" if one doesn't already exist, and then move the email to that folder (with additional rules I'd add in the future).
I tried to do it with Python
using the imaplib
and imapclient
libraries, and with NodeJS
using imap
:
EMAIL = '[email protected]'
PASSWORD = 'my_password'
IMAP = 'outlook.office365'
imap_ssl = imaplib.IMAP4_SSL(host=IMAP, port=993)
resp_code, response = imap_ssl.login(EMAIL, PASSWORD)
print("----------------")
print(resp_code)
print("----------------")
print(response)
Using both NodeJS
and Python
I tried to log into my email with my password and with an "App Password", but it does not work; I get a login error every time:
imaplib.IMAP4.error: b'LOGIN failed.'
Has anyone been through this? Did I miss a step?
本文标签: pythonScript to fetch my email and sort them to foldersStack Overflow
版权声明:本文标题:python - Script to fetch my email and sort them to folders - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736283249a1926906.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论