嗨,我有以下代码:
msg = MIMEMultipart('mixed')
msg['Subject'] = "Test Email"
msg['From'] = "test@test.de"
msg['To'] = "test2@test.de"
msg['Disposition-Notification-To'] = "test@test.de"
if msgid is None:
msgid = make_msgid()
msg['Message-ID'] = msgid
msg.attach(MIMEText(message, content_type))
server_ssl = smtplib.SMTP_SSL("smtp.gmail.com", 465)
server_ssl.ehlo()
server_ssl.login("test@test.de", "test123")
server_ssl.sendmail(user.email, ["test@test.de"], msg.as_string())
server_ssl.close()
它正在按预期方式发送邮件,但没有“送达回执”。我还尝试了“ Return-Receipt-To”,这似乎只是另一个“非正式”标准...
我在做什么错了?