Advertisement
Guest User

Untitled

a guest
Dec 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import smtplib
  2. from email.mime.text import MIMEText
  3.  
  4. server = smtplib.SMTP('smtp.develmail.com',587)
  5.  
  6. server.starttls()
  7. server.login("OCUQJ5QOP2AQ6","2Z6AR6ZNGABQM")
  8.  
  9. msg= MIMEText('Questo è il testo della mail')
  10. msg ['TO'] = "bob@mail.com"
  11. msg['From'] ="alice@mail.com"
  12. msg['Subject'] = 'Test Email con Phyton'
  13.  
  14. try:
  15. server.sendmail("alice@mail.com","bob@mail.com",msg.as_string())
  16. server.quit()
  17. print ("Mail inviata")
  18. except Exception:
  19. print ("Errore: mail non inviata")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement