Browse Source

Email not creating body message properly. fix #4996

pull/5040/head
Ruud 10 years ago
parent
commit
81655aec49
  1. 14
      couchpotato/core/notifications/email_.py

14
couchpotato/core/notifications/email_.py

@ -31,12 +31,12 @@ class Email(Notification):
starttls = self.conf('starttls') starttls = self.conf('starttls')
# Make the basic message # Make the basic message
message['Subject'] = '%s: %s' % (self.default_title, toUnicode(message)) email = MIMEText(toUnicode(message), _charset = Env.get('encoding'))
message = MIMEText(toUnicode(message), _charset = Env.get('encoding')) email['Subject'] = '%s: %s' % (self.default_title, toUnicode(message))
message['From'] = from_address email['From'] = from_address
message['To'] = to_address email['To'] = to_address
message['Date'] = formatdate(localtime = 1) email['Date'] = formatdate(localtime = 1)
message['Message-ID'] = make_msgid() email['Message-ID'] = make_msgid()
try: try:
# Open the SMTP connection, via SSL if requested # Open the SMTP connection, via SSL if requested
@ -58,7 +58,7 @@ class Email(Notification):
# Send the e-mail # Send the e-mail
log.debug("Sending the email") log.debug("Sending the email")
mailserver.sendmail(from_address, splitString(to_address), message.as_string()) mailserver.sendmail(from_address, splitString(to_address), email.as_string())
# Close the SMTP connection # Close the SMTP connection
mailserver.quit() mailserver.quit()

Loading…
Cancel
Save