Advertisement
Guest User

Untitled

a guest
Mar 30th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. 22 import smtplib
  2. 21 from time import sleep
  3. 20 import random
  4. 19
  5. 18 love = open('/tmp/frases.txt', 'r').readlines()
  6. 17
  7. 16 fromaddr = ''
  8. 15 toaddrs = ''
  9. 14
  10. 13 com = ['Com amor', 'Com esperanca', 'Com paixao', 'Com amizade', 'Com carinho', 'Com sinceridade']
  11. 12
  12. 11 para = ['Karu', 'Carlos', 'Graça', 'Gato']
  13. 10
  14. 9 # Credentials (if needed)
  15. 8 username = ''
  16. 7 password = ''
  17. 6
  18. 5 # The actual mail send
  19. 4 server = smtplib.SMTP('smtp.gmail.com:587')
  20. 3 server.starttls()
  21. 2 server.login(username,password)
  22. 1 for msg in love:
  23. 23 msg = 'Subject: {}\n\n{}'.format('{} para {}'.format(random.choice(com), random.choice(para), msg))
  24. 1 print('[*] Sending love: {}'.format(msg))
  25. 2 server.sendmail(fromaddr, toaddrs, msg)
  26. 3 sleep(15)
  27. 4 server.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement