msg['Subject'] = 'subject'
msg['From'] = 'e@mail.cc'
msg['To'] = 'e@mail.cc'
text = MIMEText('test')
msg.attach(text)
image = MIMEImage(img_data, name=os.path.basename(ImgFileName))
msg.attach(image)
s = smtplib.SMTP(Server, Port)
s.ehlo()
s.starttls()
s.ehlo()
s.login(UserName, UserPassword)
s.sendmail(From, To, msg.as_string())
s.quit()
Attachment Image to send by mail using Python