The following code (based on Python documentation and many articles about MIME messages, convenient subclasses and technical problems) when is executed It shows me that it starts[pic1] but I have to wait forever and again never starts until I kill It.
I will show you my code and I hope to find the solution!
Thanks!
import smtplib
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
msg = MIMEMultipart('multipart/related')
filename = "C:\.......\asd.png"
f = file(filename, 'rb')
attachment = MIMEImage(f.read(), _subtype="png")
attachment.add_header('Content-Disposition', 'attachment',filename=filename)
s = smtplib.SMTP('smtp.gmail.com:587')
s.ehlo()
s.starttls()
s.connect('smtp.gmail.com')
s.login('asd@gmail.com','1234')
s.sendmail('asd@gmail.com', 'asd@gmail.com', msg)
s.quit()