Advertisement
xxmbabanexx

Email Send v3

Apr 13th, 2013
171
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.74 KB | None
  1. #Email Send v3 Program. It has a basic GUI to send emails.
  2.  
  3. from Tkinter import *
  4. import smtplib
  5.  
  6. class Authen(Toplevel):
  7.     def __init__(self):
  8.         Toplevel.__init__(self)
  9.         self.grid()
  10.         self.Create_Widgets()
  11.     def Create_Widgets(self):
  12.         self.Usertext = Label(self, text = "Username: ")
  13.         self.Usertext.grid(row = 0, column = 0)
  14.         self.Username = Entry(self)
  15.         self.Username.grid(row = 0, column = 1)
  16.  
  17.         self.Passtext = Label (self, text = "Password: ")
  18.         self.Passtext.grid(row = 1, column = 0)
  19.         self.Password = Entry (self)
  20.         self.Password.grid(row = 1, column = 1)
  21.  
  22.         self.Submit = Button(self, text = "Submit Credits",
  23.                         command = self.authen_credits)
  24.         self.Submit.grid()
  25.     def authen_credits(self):
  26.         Username_mine = self.Username.get()
  27.         Password_mine = self.Password.get()
  28.         server = smtplib.SMTP('smtp.gmail.com:587')
  29.         server.ehlo()
  30.         server.starttls()
  31.         while True:
  32.             try:
  33.                 server.login(Username_mine,Password_mine)
  34.                 root.title("SMTP Mail Client GUI")
  35.                 #make my screen dimensions work
  36.                 w = 500
  37.                 h = 1000
  38.                 root.geometry("500x1000")
  39.             except smtplib.SMTPAuthenticationError:
  40.                 print "Login Failed"
  41.            
  42.        
  43.        
  44.        
  45.  
  46. class Application(Frame):
  47.     def __init__(self, master):
  48.         Frame.__init__(self, master)
  49.         self.grid()
  50.         self.entryFrame()
  51.         self.mainFrame()
  52.     def entryFrame(self):
  53.         pass
  54.     def mainFrame(self):
  55.         pass
  56.  
  57. passcheck = Authen()
  58.  
  59. root = Tk()
  60. root.mainloop()
  61. root.widthdraw()
Advertisement
RAW Paste Data Copied
Advertisement