Advertisement
Fhernd

python-r9.5-enviar-email-smtp.py

Feb 9th, 2018
1,271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. import smtplib, getpass
  2.  
  3. servidor_smtp = smtplib.SMTP('servidor.smtp.co')
  4. servidor_smtp.login(getpass.getuser(), getpass.getpass())
  5.  
  6. remitente = 'dostoevsky@email.ru'
  7. destinatario = 'balzac@email.fr'
  8. mensaje = 'From dostoevsky@email.ru\r\nTo: balzac@email.fr\r\n\r\nLee mi nueva obra Crimen y castigo'
  9.  
  10. # Envío del email:
  11. servidor_smtp.sendmail(remitente, destinatario, mensaje)
  12.  
  13. # Cierre:
  14. servidor_smtp.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement