针对具有特定主题和特定发件人的邮件

时间:2019-04-22 18:47:29

标签: python-3.x gmail smtplib

定位和删除来自特定发件人/特定主题的邮件

不知道如何进行进一步操作,但尝试使用smtplib登录到邮箱

在此处输入代码

import smtplib
from email.message import EmailMessage

mail_add = "abc@gmail.com"  # mail address
mail_pass = "pass123"

enter code here

smtp = smtplib.SMTP_SSL('smtp.gmail.com',465)
smtp.login(mail_add,mail_pass)

msg = EmailMessage()
msg['From'] = mail_add
msg['To'] = mail_pass
msg['Subject'] = "this is for testing smtplib again.."
msg.set_content("testing again")

0 个答案:

没有答案