From 9020c358190db51937c9dd211fb17a182574951d Mon Sep 17 00:00:00 2001 From: idalin Date: Thu, 23 Feb 2017 11:26:39 +0800 Subject: [PATCH] fixed send to kindle not working problem for some smtp provider. #94 --- cps/helper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cps/helper.py b/cps/helper.py index 5e9c9210..54fa1946 100755 --- a/cps/helper.py +++ b/cps/helper.py @@ -19,6 +19,8 @@ from email.MIMEBase import MIMEBase from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText from email.generator import Generator +from email.utils import formatdate +from email.utils import make_msgid from flask_babel import gettext as _ import subprocess import threading @@ -165,6 +167,8 @@ def send_mail(book_id, kindle_mail, calibrepath): # create MIME message msg = MIMEMultipart() msg['Subject'] = _(u'Send to Kindle') + msg['Message-Id'] = make_msgid('calibre-web') + msg['Date'] = formatdate(localtime=True) text = _(u'This email has been sent via calibre web.') msg.attach(MIMEText(text.encode('UTF-8'), 'plain', 'UTF-8'))