Advertisement
Guest User

Untitled

a guest
Apr 19th, 2017
544
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3.  
  4.  
  5. import smtplib
  6.  
  7.  
  8. def enviar(nombre, destinatario):
  9. msg = '''
  10. Hola %s''' % nombre
  11.  
  12. # Datos
  13. # Cuenta desde donde se enviara el correo
  14. username = 'jose.ver4@gmail.com'
  15. # Contraseña de la cuenta que emite correo
  16. password = 'slqiqlkgyeifcora'
  17.  
  18. # Enviando el correo
  19. server = smtplib.SMTP('smtp.gmail.com:587')
  20. server.starttls()
  21. server.login(username, password)
  22. server.sendmail(username, destinatario, msg)
  23. server.quit()
  24.  
  25.  
  26. def nombre(dic):
  27. return (dic['Nombre'],dic['Correo'])
  28.  
  29. #enviar(nombre.encode('utf-8'), correo.encode('utf-8'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement