I am trying to make my own "email interface", in which I need to gather the inputs from the user via the entry boxes, to use them in the email sending process. The problem is that the .get() feature always seems to error.
line 32, in send_it email_resipient = Three.get()
AttributeError: 'NoneType' object has no attribute 'get'
Please help, I have been researching for hours, and I can't seem to find a fix. Here's the code....
from tkinter import *
import smtplib
root = Tk()
root.title("Jon's Email Service")
root.geometry("800x640+0+0")
Label(root, text="Jon's Email Service", font=("arial", 60,
"bold"), fg="black").pack()
Label(root, text="User's Email address {Has to be gmail} ",
font=("arial", 20,), fg="black").pack()
One = Entry(root,width=40, bg="white").pack()
Label(root, text="User's Gmail Password", font=("arial", 20,),
fg="black").pack()
Two = Entry(root, width=40, bg="white").pack()
Label(root, text="Email Recipient", font=("arial", 20,),
fg="black").pack()
Three = Entry(root,width=40, bg="white").pack()
Label(root, text="The Message", font=("arial", 20,),
fg="black").pack()
Four = Entry(root, width=60, bg="white").pack()
def send_it():
email_resipient = Three.get()
emailUser = One.get()
user_Password = Two.get
msg = Four.get()
print(emailUser)
server = smtplib.SMTP("smtp.gmail.com", 587)
server.starttls()
server.login(emailUser, user_Password)
server.sendmail(emailUser, email_resipient, msg)
server.quit()
Label(root, text="Email Is Sent!", font=("arial", 20,),
fg="black").pack()
send = Button(root, text="Send", width = 40, bg = "lightblue",
command = send_it).pack()
root.mainloop()