-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemail.py
More file actions
29 lines (21 loc) · 665 Bytes
/
email.py
File metadata and controls
29 lines (21 loc) · 665 Bytes
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
#send mail
import smtplib
from tkinter import *
window = Tk()
window.geometry("320x240")
server = smtplib.SMTP('smtp.gmail.com',587)
server.ehlo()
server.starttls()
server.login('t5468574@gmail.com','abhilashn9')
to = Label(window, text="To").place(x=20,y=20)
message = Label(window, text="Message").place(x=20,y=60)
def send():
server.sendmail('t5468574@gmail.com',in_to.get(),in_message.get(1.0,"end"))
server.quit()
print("Message Sent!")
in_to = Entry(window)
in_to.place(x=120,y=20)
in_message = Text(window,width=15,height=5)
in_message.place(x=120,y=60)
send = Button(window,text="Send",command=send).place(x=160,y=180)
window.mainloop()