Email Application in Python mini Project
Required Softwares Download Links:
Python
https://www.python.org/downloads/
.
The Tkinter package (“Tk interface”) is the standard Python interface to the Tcl/Tk GUI toolkit. so no need to download separately.
.
PyCharm IDE
https://www.jetbrains.com/pycharm/dow...
Download PyCharm Community Edition which is 100% Free, built on open-source, and fully functional.
.
Email Application Source Code:
Just Copy and Paste the code below:
from tkinter import*
from tkinter import ttk
import smtplib
gmail_user = 'YourmailID@gmail.com'
gmail_password = 'Your Password'
def sendmail():
sent_from = gmail_user
to =txtto.get().split(",")
subject = txtsub.get()
body = T.get("1.0","end-1c")
email_text = """\
From: %s
To: %s
Subject: %s
%s
""" % (sent_from, ", ".join(to), subject, body)
try:
smtp_server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
smtp_server.ehlo()
smtp_server.login(gmail_user, gmail_password)
smtp_server.sendmail(sent_from, to, email_text)
smtp_server.close()
print("Email sent successfully!")
except Exception as ex:
print("Something went wrong….", ex)
root=Tk()
lbl1=Label(root,text="To")
lbl1.grid(row=0,column=0)
txtto=Entry(root,width=140)
txtto.grid(row=0,column=3)
lblsub=Label(root,text="Subject")
lblsub.grid(row=1,column=0)
txtsub=Entry(root,width=140)
txtsub.grid(row=1,column=3)
lblmsg=Label(root,text="Message")
lblmsg.grid(row=2,column=0)
T = Text(root, height = 10, width = 105)
T.grid(row=2,column=3)
btnsend=Button(root,command=sendmail,text="send")
btnsend.grid(row=3,column=1,columnspan=3)
root.mainloop()
On this page of the site you can watch the video online Email Application in Python mini Project | Source Code Available in Description | Vasu Ramadurai with a duration of hours minute second in good quality, which was uploaded by the user Kaalaratham Tamil Tholaikaatchi 17 December 2021, share the link with friends and acquaintances, this video has already been watched 551 times on youtube and it was liked by 17 viewers. Enjoy your viewing!