Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (30 sloc) 917 Bytes
import smtplib
from tkinter import *
def SendMail():
toaddrs = toBox.get()
fromaddrs = fromBox.get()
username = fromBox.get()
password = passBox.get()
msg = msgBox.get(0.0, END)
server = smtplib.SMTP('', 587)
server.login(username, password)
server.sendmail(toaddrs, fromaddrs, msg)
root = Tk()
root.minsize(width=600, height=500)
fromBox = Entry(root, width=45)
passBox = Entry(root, width=40, show="*")
toBox = Entry(root, width=45)
msgBox = Text(root, wrap=WORD)
sendButton = Button(root, text="Send Mail", command=SendMail)
fromBox.insert(0, "")
toBox.insert(0, "")
msgBox.insert(0.0, "Message Here...")
fromBox.pack(fill=X, expand=1)
passBox.pack(fill=X, expand=1)
toBox.pack(fill=X, expand=1)
msgBox.pack(side=TOP, fill=BOTH, expand=1)
sendButton.pack(side=TOP, fill=X, expand=1)
You can’t perform that action at this time.