The following fails with an error message about not being able to encode the euro char. It works fine without the €.
I have the feeling I'm missing something simple here, but can't figure it out. A fix would be appreciated.
I'd like to use this in 2.5.4 and 3.1
import smtplib from email.mime.text import MIMEText sender = to = 'ABC@DEF.com' server = 'smtp.DEF.com' msg = MIMEText('€10') msg['Subject'] = 'Hello' msg['From'] = sender msg['To'] = to s = smtplib.SMTP(server) s.sendmail(sender, [to], msg.as_string()) s.quit()