Hello and welcome to the stimulus, one in which are going to start writing our quote, the quote that
we are going to write and this lesson will help send an email via us A.P. server with e-mail 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 ask you to board boats and we can change this later depending
on our project or our 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 work.
Let's call it code now.
The first thing that we need to do is include some libraries, so it will start with hashtag include,
then we can add the library name, which is E.S.P 30 to underscore male client TotEx, which is basically
the library that we did, and using the managed libraries.
We did that in a previous class on.
The main library now we need to insert our network credentials, so let's add two variables.
The first one is a constant 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'll have to write constant characters.
Password.
And we'll have to enter our password.
I don't remember my password, but I will.
OK, I will use this one now.
We need to enter our e-mail settings, so you need to enter that email account and the password for
the emails and their account.
So you need to define your variables.
So let's try define e-mail sender count.
And we already know that our email is you and Angie team and Agema dot com.
Now we also have to define the password.
So email Cynda.
Passwords, we need to have the password here.
I want to write it out like that when we are testing.
Now you want to enter or you must enter that SEIP email account or the one who received the e-mail account
from your ISP board.
This is the email that we received, that email sent by our ISP to do that by design and then by email
subbrand,
then write the email.
I will send the emails to my.
You and your team at Gmail dot com, which is our.
E-mail, OK, now you need to enter your address and TB settings, and we did explain in the previous
Lassonde that some TB server settings for Gmail outlook and Hotmail account, they are consistent values
provided by each of these companies.
So you just need to copy and paste the values.
And since we are using Gmail, it will be easy.
Now, let's start by adding some TEEB server.
So I define then FTB server and I assume to be the Gmail dot com.
Next, we need to assign the support for this assumptive server.
So I define a TV server port and then write 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 E.S.P 32 just think email.
Now that we have done all of this, we need to create an awesome TB data object and we can call it a
TB data that contains the data to send via email and all other configurations.
So simply right as TB data and name it as TB data that said.
Now inside your set 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 and the password to make sure that it will connect to our local Wi-Fi
network.
Now.
We will use and if why not if statement, I want to make sure that we give people enough time to connect
so and solve this, we are going to use the state of missile status
if it is 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 print a dot or a star.
Then you need to add some delay 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 ID or password are wrong.
Now.
After that.
After we finish checking and making sure that we are connecting to our Wi-Fi network inside the setup,
we need to set some TB data object details.
So you must have some TB data.
That said, Logan, we need to set the login information that we already defined here.
So we will start with the first one, which is a SMTP server, in that case it's Google server and we
need that server board, Stoebe Server Port, and we need the e-mails and that account.
And we need the email Cynda password.
So we need to pass all of these four values to this MTV data object, after that, we need to set that
Zindani and send the email.
So.
We can use this MTV
data.
That sits in the function
and will take E.S.P further to whatever you want to name it, Cynda, then we can provide that email
Cynda account.
Now we need to send the email priority and we have a high, 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 can send the email subject so as MTBE data that said, subject the subject
for our email and we will use the one that we already found.
Email subject will define this here, email subject.
So we are using these variables.
Now.
We need to send the message itself, so we need to use assumptive data.
It message.
And inside to can plain text like Hello World, this is yes, we email this thing.
To send raw data and need to add false here, or you can send e-mail 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, be my client, BlackBerry, the Wi-Fi network name and password that's in the
account.
Email the sender password that received account, the one who received the message, the TB server information
and port and 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 serial, the print
Wi-Fi is connected.
Can then we passed the assumptive server details.
So this that object that we already defined here as some TV data we did said that get information,
the sender e-mail the priority of this email, the email subject and the message in plain text that
said for this, listen to your next and what's your next lesson and what you are going to continue writing.
Our very first called for e-mail alerts using eSport.
Thanks for watching.
This is Ashraf's from educational engineering team.