Advertisement
Guest User

Untitled

a guest
May 2nd, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.20 KB | None | 0 0
  1. import tkinter as tk
  2. import smtplib
  3. import threading
  4. import time
  5.  
  6.  
  7. def ligma_nuts():
  8.   print('start1')
  9.   time.sleep(100)
  10.   print('start 2 bitttc')
  11.  
  12.  
  13. def thread_ligma():
  14.   job = threading.Thread(target=lambda:ligma_nuts())
  15.   job.start()
  16.  
  17.  
  18. def send_email(destination):
  19.   username = "ben.dover.7319@gmail.com"
  20.   password = "Mypassword123!"
  21.  
  22.   destination = str(destination)
  23.   message = "please fricking work"
  24.  
  25.   mail = smtplib.SMTP('smtp.gmail.com', 587)
  26.   mail.ehlo()
  27.   mail.starttls()
  28.   mail.login(username, password)
  29.   print("we've logged in!")
  30.  
  31.   mail.sendmail(username, destination, message)
  32.   print("we've sent the email!")
  33.  
  34.   mail.close()
  35.  
  36.  
  37. window = tk.Tk()
  38. window.title("What's up brah")
  39.  
  40. main_screen = tk.Frame(master=window, width=500, height=50, bg="pink")
  41. main_screen.pack()
  42.  
  43. email_input = tk.Entry(master=window, width=20)
  44. email_input.pack()
  45. email_input.place(x=20, y=5)
  46.  
  47. # send_button = tk.Button(master=window, text="Send Email", bg="white", command=lambda:send_email(email_input.get()))
  48. send_button = tk.Button(master=window, text="Send Email", bg="white", command=lambda:thread_ligma())
  49.  
  50. send_button.pack()
  51. send_button.place(x=200, y=5)
  52.  
  53.  
  54. window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement