You should post all
Also all email imports should be posted.
Try line 11:
Traceback
because there is also line number of error.Also all email imports should be posted.
Try line 11:
body = MIMEText(content, 'html', 'utf-8')Line 16:
with open(filename, 'r', encoding='utf-8') as f: