Hi, welcome back and this lecture, we will discuss how it is actually being sent, the answer to this
question is the following.
You log in to your email account and completes the empty prerequisites for your email account to send
an email like to, which is to write the email address.
You were sent to your email then CCE, which is also additional recipient to your email subject, which
is the title of your email.
Then you start writing your message and click send after you have finished your message.
But what is really happening and what the front and the back end, which are the actual sender and the
recipient?
Let's try to imagine sender, which is servers of our sender, email account company, for example,
Gmail, and which will send your email and serve to send lest the recipient as the server of the recipient
account, for example, Yahoo!
Or any other email company which will receive your email and store it to the inbox list of this receiver
account.
So you send your email using the server of the Gmail company and the recipient will receive the email
using the servers of Yahoo!
Email company and vice versa.
This process will take place using as B sample mail transfer protocol, which we have installed inside
out by some three words.
And using BEP three, we will create your Gmail account and your Yamhill email account them make them
less secure using setting as the following.
We will use Google search to Google Yahoo man and then will create new Yahoo made at the following.
Click on the first link, then click create new account.
Then you will ask you to type your details in spaces that Yahoo mail specify it for you to type.
And so are you finishing adding all your details.
You will click on Continue, which is the blue bottom and the bottom of the web page.
Click on accounting will take and account security.
Then in the bottom of this page, we found generate a password's, we we click on this option and select
other and then.
Five in the name of our new python, a business e-mail list, and click on it to generate a password
for this new Python app.
Which will make it able to send email and log in to Yahoo account, then copy this password and click
done.
Now we will head over Google Search again to create your Gmail account, the following.
Click on, uh, Gmail.
Then let create your account or sign up.
Zanti Venuti tells.
And the is specified for that, as you know, first name and last name and your user name and Gmail
and password and confirm this password and click next.
Now, that is an option to add in your phone number and your birthday in the four months, then days
and years.
And you're, again, just a few hope.
So then you click next.
Now, you should agree on the terms and conditions of the Gmail account.
Now we have created new Gmail account.
But what next?
The next step to make this email account or Gmail account to be less secure by clicking on Gmail account
and manage your account, then security, then ensure that the option of use your phone to sign and
to step verification that you are OK, then make our email secure and the option of less secure app
access.
Click on it, then turn this option on.
Now you can use that to account and the Python code to send emails from one to another and vice versa.
We will jump in sublime text and complete our code as the following.
The first step, as we say before, to import s empty B lap.
So from s empty D lab and board s m db.
In our case, my email or my underscore equal then between two Central Coast or the West Coast, we
must fight them and we will send.
Our email from.
So we will dive team Utech Academy at Yahoo!
Dot com, and in the next line we will declare and assign a variable called Connect Underscore Server
Equal.
As MTV, in our case, between two parentheses.
And to single or double quotes.
That's the name for Yahoo!
Or the sender.
If your sender is a Yahoo, you will add the hostname for a Yahoo as the following, you will type hostname
for Yahoo!
And the Google search.
That will return those to me that you want for me, for example, will be as MTV dot.
Gmail dot com.
And Fauria, who has MTV, dot, dot, yahoo dot com.
Jimenez and A.B. dodgy mint.com, as I said, and Yahoo!
As MTV dot m. dot yahoo dot com.
This is IV for our exemptive server.
Then again, the next line, I will magnify my code to be ultrathin and more visible and clear for you,
then we will declare another variable called password's.
To be equal, the best word of the.
App we created and generate its password and Yahoo mail security.
Cap, sorry for adding around password for Yahoo mail, which will be corrected after I will finish
my call.
Now we will focus on completing our code as the following.
So we will initiate a method that will encrypt our that will be sent using this Python code as the following.
So Connect underscored server dot star to unless.
Which is a method to correct our message inside, inside our I now we will Google it to know more about
this method as the following.
You can use this webpage, send the grid to know more about starchier less and another incorrect method
to incorrect your message inside your email sending using Python code.
I know.
How does it work or how does it start?
Tell us what to encrypt our message inside our mind and another.
And with the codes as SSL.
OK, and what is the relation between email client and email server and to have the start to a less
incorrect message between them to make it impossible for anyone to read this message.
And we will use two methods.
Method for logging, which is connect underscores the DOT login which take two parameters.
User equals sender, as we specified as a variable in the first beginning of the code and password a
password variable.
And the connect underscores that we don't send them in to send our mail and take three parameters which
are from add or address from underscore address equals sender and to underscore address a d.
E.
S equal recipient and the message between two single codes.
Hi there.
And run our code.
Finally, it is one of the best practices to close the server or the connection after we finish sending
our mail.
So connect on those core server dot, close method, well, close the connection and build our broad
project based on good.
It will give us an error because of to address.
Not contain E, we will remove the E letters from two address to B to underscore a d r.
S and run our project again to run successfully and two point nine seconds and the email will be and
sent for the e mail from Timothy Academy and Gmail dot com.
Hi there.
To Inbox of the Yahoo Mail.
We will refresh.
Refresh again is Ben.
This ends as Ben.
We will remove the old one, then move the new one to the inbox.
Move to the inbox and our mail or email, finally.
It's an.
A box of yellow means hi there from Timothy Take Academy Agema, but there is an issue here, not important,
but we will solve it.
Our Amien has no subject.
We will add the subject of our email, add the following, but we first will stop accounts to send email
from Yahoo to me.
So we will enter the accounts of Gemal Tech and Time our password again.
Our best word.
Again.
Then after we look, logon.
We click on security in our account or account security.
And as I said before, we in the bottom of the page manage passwords, then still delete our old app
and create new one business email list as a business email list.
Generate copy this password done.
Then paste this password in the password variable between the two two single codes, change the sender
to team with take academy at yellow dot com, and the password is the password generated by the app
management in your account.
And the recipient will be Team Tech Academy and Gmail dot com.
And the host will be that man, that yellow dot com.
Then we will add the subject to our main inside the message as the following.
And is that to take care of the addition to the code?
So inside the message equal between the two parenthesis, hi there, we will as subject column discount
offer between without no spaces between the column and discount offers and new line new lines.
Hi there.
Full stop and run our quote again at will run successfully and our men will be sent from Yahoo!
To Gmail.
Successfully with the subject and the message, and we will ensure of that had the fun by jumping into
the two email accounts to ensure all of the email sent using Python code and go to the send email list
and the Yahoo account.
That will show the email sent and the subject at discounts offer and inbox.
We will refresh the inbox of the mail and found our email with the subject discount offer and the message,
Heidi.
We now successfully able to send mail using Python code at this point.
We reached the end of this lecture.
Hope you enjoyed this lecture and to get all of that.
Thanks for being here and thanks for watching.
See you next with you.