fix email generation: remove 'encode()'

This commit is contained in:
Helmut Merz 2024-12-31 14:44:12 +01:00
parent 8a578b46a8
commit eddb58c794

View file

@ -195,8 +195,10 @@ class SendEmail(FormController):
# TODO: remove duplicates
person = getPersonForUser(self.context, self.request)
sender = person and adapted(person).email or 'loops@unknown.com'
msg = MIMEText(message.encode('utf-8'), 'plain', 'utf-8')
msg['Subject'] = subject.encode('utf-8')
#msg = MIMEText(message.encode('utf-8'), 'plain', 'utf-8')
msg = MIMEText(message, 'plain', 'utf-8')
#msg['Subject'] = subject.encode('utf-8')
msg['Subject'] = subject
msg['From'] = sender
recipients = [r.strip() for r in recipients if r.strip()]
msg['To'] = ', '.join(recipients)