Skip to content

Commit

Permalink
Fix replace, add
Browse files Browse the repository at this point in the history
  • Loading branch information
ggcatu authored and tino097 committed Sep 26, 2017
1 parent a75e2a1 commit b936fa5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ckan/lib/mailer.py
Expand Up @@ -33,7 +33,10 @@ def _mail_recipient(recipient_name, recipient_email,
mail_from = config.get('smtp.mail_from')
msg = MIMEText(body.encode('utf-8'), 'plain', 'utf-8')
for k, v in headers.items():
msg[k] = v
if k in msg.keys():
msg.replace_header(k, v)
else:
msg.add_header(k, v)
subject = Header(subject.encode('utf-8'), 'utf-8')
msg['Subject'] = subject
msg['From'] = _("%s <%s>") % (sender_name, mail_from)
Expand Down

0 comments on commit b936fa5

Please sign in to comment.