Python: “subject” not shown when sending email using smtplib module

Attach it as a header:

message="Subject: {}\n\n{}".format(SUBJECT, TEXT)

and then:

server = smtplib.SMTP(SERVER)
server.sendmail(FROM, TO, message)
server.quit()

Also consider using standard Python module email – it will help you a lot while composing emails.

Leave a Comment