Sending Email using Python
How to send Email using simple Python Codes.
How we can send emails without using any application or browser. we will use simple python codes.
To write code open your Python text editor, Open it, create a new python file and Name it.
For sending email we will use a python library called smtplib.
So first we have to install smtplib (if already not installed)
To install smtplib go to Text editor terminal or CMD and type this simple command
Pip install secure-smtplib
Press enter
Go to the editor and import smtplib, type Import Smtplib then
creat variable with a name for example Mail, (this variable can be created with any name I am using Mail here.
Mail = smtplib.SMTP(smtp.gmail.com, 587)
Smtp (Simple Mail Transfer Protocol) is a protocol used for sending email over the internet, and smtp.gmail.com is the smtp server address of Gmail because I am using Gmail Account so I will use smtp address of Gmail Server with its port number 587.
Mail.ehlo()
Mail.Starttls()
Ehlo and starttls are both protocols used for server connection, it will establish a connection with Gmail Server.
To login to the Gmail we will use Gmail Account.
Mail .login()
Now to Send email we will use Mail.sendmail.
Mail.sendmail (This segment of our code will need 3 types of arguments,
these are
1. Sender Email Address,
2. Receiver Email Address and
3. Message.
Authentication Error may be because of wrong Email or Password, or may be because of Google default setting which not allowing less secure application to send mail from Gmail.
So we have to change that setting in Manage Google Account.
So, this is how we can send and automate sending emails with python.
That’s all for now.
See you with a next Tutorial soon.
If you have any question or suggestion regarding this topic please let us know in comment section, will be in touch with you soon.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Sending Email using Python», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.