I have a very simple piece of code (just for testing):
server = 'smtp.myprovider.com'
recipients = ['email@example.com']
sender = 'firstname.lastname@example.org'
message = 'Subject: [PGS]: Results\n\nBlaBlaBla'
session = smtplib.SMTP(server)
smtplib doesn't automatically include a
From: header, so you have to put one in yourself:
message = 'From: email@example.com\nSubject: [PGS]: Results\n\nBlaBlaBla'
smtplib doesn't include any headers automatically, but just sends the text that you give it as a raw message)