我正在编写一个小脚本来发送电子邮件,我想跟踪谁用python模块pytracking打开电子邮件,如下所示:
import smtplib
import pytracking
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
fromaddr = "info@XXXXXXXXXX.com"
toaddr = "XXXXXXXXa@gmail.com"
msg = MIMEMultipart()
#Not sure if this is the right location for the pixel
pixel= (pixel_byte_string, mime_type) = pytracking.get_open_tracking_pixel()
msg['From'] = fromaddr
msg['To'] = toaddr
msg['Subject'] = "grande"
body = "bla bla bla"
msg.attach(MIMEText(body, 'plain'))
server = smtplib.SMTP('mail.XXXXXXXX.com', 587)
server.ehlo()
server.starttls()
server.ehlo()
server.login('info@XXXXXXXX.com','XXXXXXXX')
text = msg.as_string()
server.sendmail(fromaddr, toaddr, text)
print('DONE')
我阅读了这个模块here的完整文档,但我找不到实际检查像素是否已被打开的位置或我运行的命令shell。
有人可以建议如何检查像素是否已被打开? 感谢