-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmail.py
More file actions
39 lines (29 loc) · 1.01 KB
/
mail.py
File metadata and controls
39 lines (29 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from tkinter import *
import smtplib
mail=Tk()
mail.geometry('640x640+0+0')
sender=StringVar()
password=StringVar()
receiver=StringVar()
message=StringVar()
sender2=Label(mail,text='Sender').place(x=20,y=50)
password2=Label(mail,text='Password').place(x=20,y=90)
receiver2=Label(mail,text='Receiver').place(x=20,y=130)
message2=Label(mail,text='Message').place(x=20,y=170)
sender1=Entry(mail,textvariable=sender).place(x=130,y=50)
password1=Entry(mail,textvariable=password,show='*').place(x=130,y=90)
receiver1=Entry(mail,textvariable=receiver).place(x=130,y=130)
message1=Text(mail,width=20, height=10)
message1.place(x=130,y=170)
def event():
s1=sender.get()
p=password.get()
r=receiver.get()
m=message1.get(1.0,END)
s = smtplib.SMTP('smtp.gmail.com', 587)
s.starttls()
s.login(s1,p)
s.sendmail(s1,r,m)
s.quit()
B = Button(mail, text ='Submit', command = lambda : event()).place(x=70,y=400)
mail.mainloop()