What are emails?
Emails are messages distributed by electronic means from one computer user to another. There can be many more recipient as well via network.
Methods we can use to send an email:
- We can use python web automation using selenium.
We have a python library which is SMTP library which can be used to send an email.
But for this article I shall be explaining how to use the STMP library.
STMP which means simple transfer mail protocol. STMP library, this library or the modules defines an SMTP clients session object which can be used to send an email to any other internet machine with an STMP or E-STMP listener daemon.
: import smtplib server = smtplib.SMTP_SSL('smtp.gmail.com', 465) server.login('firstname.lastname@example.org', 'password') server.sendmail('email@example.com', 'firstname.lastname@example.org', 'Hi happiness,how are you?') server.quit()
Quickly what you should note:
"email@example.com"-your email address should be there
"password"-the password to your email address
"firstname.lastname@example.org"-the receiver's email address.
then you go ahead with the body of the message.
Finally you have to enable your "less secure app" from your google account in order to send the message.