1
00:00:00,570 --> 00:00:07,530
Hello and welcome to the Cinderella Sun inner child going to start writing our code, the clothes that

2
00:00:07,530 --> 00:00:16,800
we are going to write and this lesson will help send an email via a SMTP server with a steam URL or

3
00:00:16,800 --> 00:00:19,590
text or any other thing that you want to send.

4
00:00:20,310 --> 00:00:29,490
Now, for the sake of testing, we are only sending an email once when they SPF 30 to a bald boats,

5
00:00:29,580 --> 00:00:39,060
and we can change this later, depending on our project or specific properties or what we want.

6
00:00:39,630 --> 00:00:43,250
Now you should be able to create the code easily.

7
00:00:43,290 --> 00:00:51,390
I will go with you on a step by step manner and we will start by creating a new Arduino project.

8
00:00:52,380 --> 00:00:54,390
Then let's save this project.

9
00:00:55,500 --> 00:00:57,930
To make sure that we save our world.

10
00:01:00,080 --> 00:01:03,590
Let's call it cods now.

11
00:01:03,620 --> 00:01:07,940
The first thing that we need to do is include some libraries.

12
00:01:08,600 --> 00:01:20,750
So we will start with hashtag include then we can add the library name, which is SB 30, to underscore

13
00:01:21,230 --> 00:01:31,200
male client the text, which is basically the library that we did using the managed libraries.

14
00:01:31,220 --> 00:01:32,930
We did that in a previous lesson.

15
00:01:34,850 --> 00:01:40,310
The maintenance library now we need to insert our network credentials.

16
00:01:41,150 --> 00:01:43,640
So let's add two variables.

17
00:01:43,880 --> 00:01:51,200
The first one is consistent character for the network credential as a side,

18
00:01:54,140 --> 00:01:57,530
and my network name is Ashraf TV.

19
00:02:00,140 --> 00:02:08,200
And we also need to enter a password, so we'd have tried constant characters.

20
00:02:10,850 --> 00:02:11,600
Passwords.

21
00:02:14,690 --> 00:02:16,700
And we'd have to enter our password.

22
00:02:21,650 --> 00:02:24,170
I don't remember what my password, but I will.

23
00:02:27,690 --> 00:02:30,690
OK, I will use this one.

24
00:02:32,160 --> 00:02:35,550
Now we need to enter our email settings.

25
00:02:35,760 --> 00:02:42,330
Sorry to interrupt the emails and that account and the password for the emails in that account, so

26
00:02:43,020 --> 00:02:44,820
you need to define your variables.

27
00:02:46,080 --> 00:02:50,860
So let's try to define email sender account.

28
00:02:52,050 --> 00:03:00,720
And we already know that our email is the Angie team and GM of this column.

29
00:03:03,930 --> 00:03:08,400
Now we also have to define the password.

30
00:03:09,000 --> 00:03:10,710
So email sender.

31
00:03:13,170 --> 00:03:17,040
Passwords, we need to enter the passwords here.

32
00:03:17,310 --> 00:03:20,670
I want to write it all like this when we have this thing.

33
00:03:21,120 --> 00:03:30,090
Now you want to enter or you must enter that AC email account or the one who received the email account

34
00:03:30,300 --> 00:03:31,710
from your ISP board.

35
00:03:32,220 --> 00:03:42,510
This is the email that we received, the email sent by our ISP to do that by Define Underbite Email

36
00:03:43,680 --> 00:03:44,280
Sabrent,

37
00:03:47,820 --> 00:03:50,670
then write the email.

38
00:03:50,850 --> 00:03:52,260
I will send the emails to my.

39
00:03:54,740 --> 00:03:58,910
You and your team at Gmail dot com, which is our.

40
00:04:00,230 --> 00:04:07,780
Should email OK now you need to enter your list and TBE settings.

41
00:04:08,150 --> 00:04:16,400
And we did, except in the previous lesson that it's A. B. Server settings for Gmail, Outlook and Hotmail

42
00:04:16,400 --> 00:04:16,910
accounts.

43
00:04:16,910 --> 00:04:23,450
They are a constant values provided by each of these companies, so you just need to copy and paste

44
00:04:23,930 --> 00:04:24,920
the values on.

45
00:04:24,920 --> 00:04:27,980
Since we are using Gmail, it will be easy.

46
00:04:29,240 --> 00:04:33,050
Now let's start by adding some TB server.

47
00:04:35,700 --> 00:04:47,700
So I define then some TB server and right as some TB, the Gmail dot com.

48
00:04:48,960 --> 00:04:53,190
Next, we need to assign the port for some TB server.

49
00:04:53,370 --> 00:05:04,350
So what I define as some TB server port and the right, the number four hundred sixty five.

50
00:05:05,810 --> 00:05:16,140
Now we need to write the email subject so we can also use, define, define, email subject

51
00:05:18,510 --> 00:05:19,950
and we can.

52
00:05:20,460 --> 00:05:27,660
But ISP 32 testing email.

53
00:05:29,850 --> 00:05:36,630
Now that we have done all of this, we need to create an awesome TB data object and we kind of call

54
00:05:36,630 --> 00:05:43,740
it a TB data that contains the data to send via email and all other configurations.

55
00:05:44,220 --> 00:05:53,010
So simply write some TB data and name it some TB data.

56
00:05:55,150 --> 00:05:55,710
That's it.

57
00:05:56,640 --> 00:05:59,310
Now inside your sit up.

58
00:06:00,560 --> 00:06:06,170
This is it for the configuration before the setup function.

59
00:06:07,580 --> 00:06:16,910
Now inside the setup, we need to start the Wi-Fi connection using lifeguarded begin and we need to

60
00:06:16,910 --> 00:06:26,060
pass this aside for the network on the password to make sure that it will connect to our local Wi-Fi

61
00:06:26,060 --> 00:06:26,540
network.

62
00:06:26,840 --> 00:06:27,290
Now.

63
00:06:29,110 --> 00:06:30,250
We will use an if.

64
00:06:30,430 --> 00:06:38,200
Why not if statement I wanted to make sure that we give yes people enough time to connect.

65
00:06:38,830 --> 00:06:44,950
So on top of this, we are going to use the state of missile status.

66
00:06:48,070 --> 00:06:56,850
If it's not equal wireless connected, then it means that Wi-Fi is not connected yet.

67
00:06:56,860 --> 00:07:05,890
And in that case, for debugging, we can print something we can't print a dot or start.

68
00:07:07,090 --> 00:07:11,560
Then you need to add somebody to give it enough time to connect.

69
00:07:12,010 --> 00:07:17,770
Now, if it's not connected, it will keep printing stars until it connects.

70
00:07:18,460 --> 00:07:24,820
Maybe your Wi-Fi is offline or your username as a side or password are wrong.

71
00:07:25,560 --> 00:07:25,900
Now.

72
00:07:28,450 --> 00:07:29,260
After that.

73
00:07:30,450 --> 00:07:36,300
After we finish checking and making sure that you are connecting to our Wi-Fi network inside the setup,

74
00:07:37,230 --> 00:07:48,900
we need to set all us TB data object details, so you must have some TB data not set in.

75
00:07:49,800 --> 00:07:53,850
We need to set the information that we already defined here.

76
00:07:55,790 --> 00:08:05,780
So we will start with the first one, which is a TBE server, in that case, it's Google server, and

77
00:08:05,780 --> 00:08:13,730
we knew the server bought TBE Server Port and we need the emails and that account.

78
00:08:16,490 --> 00:08:22,760
And leave the email sender passport.

79
00:08:26,180 --> 00:08:32,480
So we need to pass on these four values to this TB that object.

80
00:08:33,230 --> 00:08:37,520
After that, we need to set the sender name and send the email.

81
00:08:38,910 --> 00:08:39,390
So.

82
00:08:40,620 --> 00:08:42,810
We can't use this empty

83
00:08:45,540 --> 00:08:46,050
data.

84
00:08:50,130 --> 00:08:52,260
That sits in that function

85
00:08:54,870 --> 00:09:08,210
and will take ESB further to whatever want to name it, Senator, then we can provide that email, send

86
00:09:08,500 --> 00:09:09,750
the account.

87
00:09:12,620 --> 00:09:20,120
Now we need to send the email priority, and we have a tie low or medium.

88
00:09:20,930 --> 00:09:22,550
It's something you can't ignore.

89
00:09:22,790 --> 00:09:31,310
But I prefer adding high priority to make sure that we send it as high priority email.

90
00:09:34,300 --> 00:09:38,920
Now you can enter high, low, medium or you can use numbers.

91
00:09:43,540 --> 00:09:43,890
OK.

92
00:09:45,640 --> 00:09:56,020
After doing that, we send the email subject so a I of TB data that sits subject the subject for our

93
00:09:56,020 --> 00:10:05,350
email and we will use the one that we already find email subject will define this here.

94
00:10:07,030 --> 00:10:07,960
Email subject.

95
00:10:07,960 --> 00:10:09,760
So we using these variables.

96
00:10:12,020 --> 00:10:12,530
Now.

97
00:10:14,500 --> 00:10:16,660
We need to accept the message itself.

98
00:10:16,810 --> 00:10:22,480
So we need to use some TB data that said message.

99
00:10:25,460 --> 00:10:36,950
And inside two candlelight plain text like Hello World, this is yes, we e-mail this thing.

100
00:10:39,490 --> 00:10:48,640
To send raw data and to add false here, or you can send a stem cell data, and we are going to explain

101
00:10:48,640 --> 00:10:50,560
this in the next lesson.

102
00:10:51,160 --> 00:10:52,390
But that's it for this lesson.

103
00:10:52,420 --> 00:10:59,590
Let's summarize we included that, yes, biomedical science library, the Wi-Fi network name and password

104
00:11:00,670 --> 00:11:02,170
that's in that account.

105
00:11:02,170 --> 00:11:06,320
Email that's in the password that sealed the account.

106
00:11:06,370 --> 00:11:14,560
The one who received the message, the TB server information and port on the email subject.

107
00:11:14,860 --> 00:11:21,340
After that, we started the Wi-Fi connection process and we waited until Wi-Fi is connected.

108
00:11:21,340 --> 00:11:22,480
We can add the line here.

109
00:11:23,560 --> 00:11:26,770
We can say a serial that plant

110
00:11:29,320 --> 00:11:30,520
Wi-Fi is connected.

111
00:11:33,140 --> 00:11:39,560
And then we passed the self of details.

112
00:11:40,950 --> 00:11:49,380
So this that object that we already defined here as some TB data we did said that will get information

113
00:11:49,380 --> 00:11:52,200
that's in email the priority of this email.

114
00:11:52,590 --> 00:11:55,740
The email subject and the message in plain text.

115
00:11:56,760 --> 00:11:57,810
That's it for this lesson.

116
00:11:57,820 --> 00:11:58,410
So you're next.

117
00:11:58,760 --> 00:12:06,480
And watch cynic's lesson and what you are going to continue writing our very first call for email alerts

118
00:12:06,630 --> 00:12:08,070
using e-sport.

119
00:12:08,460 --> 00:12:09,150
Thanks for watching.

120
00:12:09,180 --> 00:12:11,570
This is Ashraf from educational engineering team.
