Hello and welcome to the Cinderella Sun inner child going to start writing our code, the clothes that
we are going to write and this lesson will help send an email via a SMTP server with a steam URL or
text or any other thing that you want to send.
Now, for the sake of testing, we are only sending an email once when they SPF 30 to a bald boats,
and we can change this later, depending on our project or specific properties or what we want.
Now you should be able to create the code easily.
I will go with you on a step by step manner and we will start by creating a new Arduino project.
Then let's save this project.
To make sure that we save our world.
Let's call it cods now.
The first thing that we need to do is include some libraries.
So we will start with hashtag include then we can add the library name, which is SB 30, to underscore
male client the text, which is basically the library that we did using the managed libraries.
We did that in a previous lesson.
The maintenance library now we need to insert our network credentials.
So let's add two variables.
The first one is consistent character for the network credential as a side,
and my network name is Ashraf TV.
And we also need to enter a password, so we'd have tried constant characters.
Passwords.
And we'd have to enter our password.
I don't remember what my password, but I will.
OK, I will use this one.
Now we need to enter our email settings.
Sorry to interrupt the emails and that account and the password for the emails in that account, so
you need to define your variables.
So let's try to define email sender account.
And we already know that our email is the Angie team and GM of this column.
Now we also have to define the password.
So email sender.
Passwords, we need to enter the passwords here.
I want to write it all like this when we have this thing.
Now you want to enter or you must enter that AC email account or the one who received the email account
from your ISP board.
This is the email that we received, the email sent by our ISP to do that by Define Underbite Email
Sabrent,
then write the email.
I will send the emails to my.
You and your team at Gmail dot com, which is our.
Should email OK now you need to enter your list and TBE settings.
And we did, except in the previous lesson that it's A. B. Server settings for Gmail, Outlook and Hotmail
accounts.
They are a constant values provided by each of these companies, so you just need to copy and paste
the values on.
Since we are using Gmail, it will be easy.
Now let's start by adding some TB server.
So I define then some TB server and right as some TB, the Gmail dot com.
Next, we need to assign the port for some TB server.
So what I define as some TB server port and the right, the number four hundred sixty five.
Now we need to write the email subject so we can also use, define, define, email subject
and we can.
But ISP 32 testing email.
Now that we have done all of this, we need to create an awesome TB data object and we kind of call
it a TB data that contains the data to send via email and all other configurations.
So simply write some TB data and name it some TB data.
That's it.
Now inside your sit up.
This is it for the configuration before the setup function.
Now inside the setup, we need to start the Wi-Fi connection using lifeguarded begin and we need to
pass this aside for the network on the password to make sure that it will connect to our local Wi-Fi
network.
Now.
We will use an if.
Why not if statement I wanted to make sure that we give yes people enough time to connect.
So on top of this, we are going to use the state of missile status.
If it's not equal wireless connected, then it means that Wi-Fi is not connected yet.
And in that case, for debugging, we can print something we can't print a dot or start.
Then you need to add somebody to give it enough time to connect.
Now, if it's not connected, it will keep printing stars until it connects.
Maybe your Wi-Fi is offline or your username as a side or password are wrong.
Now.
After that.
After we finish checking and making sure that you are connecting to our Wi-Fi network inside the setup,
we need to set all us TB data object details, so you must have some TB data not set in.
We need to set the information that we already defined here.
So we will start with the first one, which is a TBE server, in that case, it's Google server, and
we knew the server bought TBE Server Port and we need the emails and that account.
And leave the email sender passport.
So we need to pass on these four values to this TB that object.
After that, we need to set the sender name and send the email.
So.
We can't use this empty
data.
That sits in that function
and will take ESB further to whatever want to name it, Senator, then we can provide that email, send
the account.
Now we need to send the email priority, and we have a tie low or medium.
It's something you can't ignore.
But I prefer adding high priority to make sure that we send it as high priority email.
Now you can enter high, low, medium or you can use numbers.
OK.
After doing that, we send the email subject so a I of TB data that sits subject the subject for our
email and we will use the one that we already find email subject will define this here.
Email subject.
So we using these variables.
Now.
We need to accept the message itself.
So we need to use some TB data that said message.
And inside two candlelight plain text like Hello World, this is yes, we e-mail this thing.
To send raw data and to add false here, or you can send a stem cell data, and we are going to explain
this in the next lesson.
But that's it for this lesson.
Let's summarize we included that, yes, biomedical science library, the Wi-Fi network name and password
that's in that account.
Email that's in the password that sealed the account.
The one who received the message, the TB server information and port on the email subject.
After that, we started the Wi-Fi connection process and we waited until Wi-Fi is connected.
We can add the line here.
We can say a serial that plant
Wi-Fi is connected.
And then we passed the self of details.
So this that object that we already defined here as some TB data we did said that will get information
that's in email the priority of this email.
The email subject and the message in plain text.
That's it for this lesson.
So you're next.
And watch cynic's lesson and what you are going to continue writing our very first call for email alerts
using e-sport.
Thanks for watching.
This is Ashraf from educational engineering team.