Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import smtplib
- from email.mime.text import MIMEText
- server = smtplib.SMTP('smtp.develmail.com',587)
- server.starttls()
- server.login("OCUQJ5QOP2AQ6","2Z6AR6ZNGABQM")
- msg= MIMEText('Questo è il testo della mail')
- msg ['TO'] = "bob@mail.com"
- msg['From'] ="alice@mail.com"
- msg['Subject'] = 'Test Email con Phyton'
- try:
- server.sendmail("alice@mail.com","bob@mail.com",msg.as_string())
- server.quit()
- print ("Mail inviata")
- except Exception:
- print ("Errore: mail non inviata")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement