1 00:00:02,360 --> 00:00:07,520 Now that we have created a plaintext email, let's learn how to create. 2 00:00:09,450 --> 00:00:23,900 My message, an e-mail, you will use the very same coding data, the message, and inside here, you 3 00:00:23,970 --> 00:00:29,610 add your first annual add through to means you will you are passing Astrium Alcalde. 4 00:00:29,610 --> 00:00:35,810 False means you are passing plain text now since we did right through here. 5 00:00:36,080 --> 00:00:37,140 Let's remove the comment. 6 00:00:38,340 --> 00:00:42,120 We can add e-mail here and two additional code. 7 00:00:42,120 --> 00:00:44,350 We have to get a simple code to begin with. 8 00:00:44,670 --> 00:00:57,780 So here is an online code editor and you can use this one or this one W three school or the online code 9 00:00:57,780 --> 00:00:58,230 editor. 10 00:00:59,770 --> 00:01:00,340 This one. 11 00:01:01,380 --> 00:01:03,570 So if you want to use this one. 12 00:01:05,570 --> 00:01:12,080 As you can see, this is the online editor for this website, you can write your text and. 13 00:01:13,260 --> 00:01:17,930 Right here and see it here, see what's happening here. 14 00:01:19,020 --> 00:01:26,670 So to all this text, you can edit the heading, this is the headings, you can write your name and 15 00:01:26,670 --> 00:01:28,980 click run and will be visible here. 16 00:01:29,520 --> 00:01:30,900 Same for other things. 17 00:01:30,900 --> 00:01:32,760 Or you can simply try this one. 18 00:01:33,270 --> 00:01:37,500 You can start writing Hello, World. 19 00:01:41,430 --> 00:01:51,300 E.S.P, 32 a.m. this thing, and you can simply copy this code. 20 00:01:52,650 --> 00:01:58,620 This is a simple code for this line, you can add other information, you can. 21 00:02:00,910 --> 00:02:06,880 How long it takes to be in the middle, you can increase the font size or change the font color. 22 00:02:08,090 --> 00:02:13,220 You can choose different formats if you want to make it as hidden as you can see. 23 00:02:15,690 --> 00:02:20,070 That's more the background color and add a red color for the text itself. 24 00:02:20,490 --> 00:02:27,360 Now you can copy all of this and simply based it inside your code, right. 25 00:02:27,360 --> 00:02:28,410 Click and copy. 26 00:02:28,530 --> 00:02:30,000 Then go inside your code. 27 00:02:30,420 --> 00:02:31,800 Base it right here. 28 00:02:33,290 --> 00:02:36,320 As you can see, this is our Astrium alcalde. 29 00:02:39,600 --> 00:02:40,110 Now. 30 00:02:41,130 --> 00:02:48,150 You can use this or you can use the raw text, it's up to you in my case, I will start with the raw 31 00:02:48,150 --> 00:02:50,920 text, then we can text with e-mail. 32 00:02:51,640 --> 00:02:55,890 Now, let's move on with code editing. 33 00:02:57,300 --> 00:03:02,640 Now, the final step is setting the recipient email address. 34 00:03:03,180 --> 00:03:09,840 So like a Stoebe data dot and the recipient. 35 00:03:13,940 --> 00:03:18,800 And inside it, all right, email re sibilant. 36 00:03:23,470 --> 00:03:31,510 That's it now that we have all the details of this and T.B. data, we are ready to send the email. 37 00:03:31,870 --> 00:03:35,110 So to send the email, you need to write if. 38 00:03:37,290 --> 00:03:47,770 Statement and inside, if you need to write this Manicaland, don't send email. 39 00:03:48,510 --> 00:03:57,030 We are using the send email function and we are passing this MTBE data that we already filled here and 40 00:03:57,030 --> 00:03:57,750 these lines. 41 00:03:59,620 --> 00:04:00,190 Now. 42 00:04:01,380 --> 00:04:07,060 After that, we can print Syria, not print, Alan. 43 00:04:09,230 --> 00:04:13,240 If there is an error, we can see error. 44 00:04:16,390 --> 00:04:29,080 And sending the email and we can give the error code from the mail fly and you can light mail client 45 00:04:29,890 --> 00:04:35,890 dot as MTBE or Rezo. 46 00:04:39,640 --> 00:04:48,670 This is how you can give that email all, it will most likely print out a code that you can look up 47 00:04:48,670 --> 00:04:51,580 using Google to know exactly what's a problem. 48 00:04:52,180 --> 00:04:57,040 After sending the email, you can clear all the data from this MTBE that object. 49 00:04:57,550 --> 00:05:06,400 And we can do this using one single line, which is MTBE, that empty the empty function is the one 50 00:05:06,760 --> 00:05:09,730 that we can use to send empty emails. 51 00:05:11,040 --> 00:05:18,180 Now we are sending the email and the step function, this means that the email will be sent once and 52 00:05:18,180 --> 00:05:22,470 you have to pause to unplug, then plug it again. 53 00:05:22,480 --> 00:05:24,510 They ask people to send another email. 54 00:05:24,870 --> 00:05:32,040 If you want to send the email more than once, you can simply use this method to send email methode 55 00:05:32,340 --> 00:05:33,700 inside the loop function. 56 00:05:34,230 --> 00:05:37,500 Now, for example, the loop function is empty. 57 00:05:38,860 --> 00:05:50,040 Now we can start this thing, this cold out, but we can add even more stuff in the loop function now 58 00:05:50,050 --> 00:05:55,250 you can create a callback function to get the email sending states to do that. 59 00:05:55,270 --> 00:05:56,350 There is a very. 60 00:05:57,350 --> 00:06:03,080 Easy method, you can simply define a callback function like void. 61 00:06:04,520 --> 00:06:05,620 Let me show it to you. 62 00:06:08,670 --> 00:06:14,730 Let's create a new function and name it send call back. 63 00:06:17,960 --> 00:06:18,500 No. 64 00:06:21,430 --> 00:06:26,030 The callback function will have a simple chord. 65 00:06:26,050 --> 00:06:36,370 We are going to write the serial masterbrand plan and here we are going to write the message that four. 66 00:06:39,050 --> 00:06:41,180 And we need to pass the message here. 67 00:06:46,340 --> 00:06:49,730 Send a status 68 00:06:52,070 --> 00:06:57,140 message now when the ServiceMaster is sent. 69 00:06:57,230 --> 00:07:06,110 We call it an statement and this statement will include the message is success in sending. 70 00:07:08,000 --> 00:07:15,800 Then we need to write, I think, for the bugging inside. 71 00:07:18,430 --> 00:07:20,900 OK, we can't light the signs. 72 00:07:22,410 --> 00:07:32,300 This means that the message was sent successfully, otherwise the message will we will get a code or 73 00:07:32,820 --> 00:07:37,200 a. MTV terrorism called on our serial murderer. 74 00:07:37,860 --> 00:07:43,380 Now, this is how you can create a callback function to get the email sinding status. 75 00:07:43,800 --> 00:07:44,220 Sorry. 76 00:07:45,930 --> 00:07:51,870 Now, that's it, what you need to do next is very simple, you need to verify the code to make sure 77 00:07:51,870 --> 00:07:59,100 that it doesn't have any errors, then we will upload the code to our ISP board. 78 00:08:12,640 --> 00:08:15,490 It will take a few seconds to compile the code. 79 00:08:33,270 --> 00:08:41,750 OK, as you can see here, have an arrow as MTV support was not defined in this school. 80 00:08:43,710 --> 00:08:45,900 Let's make sure that we have. 81 00:08:46,870 --> 00:08:50,890 That SMTP server port. 82 00:08:53,230 --> 00:08:56,530 Oh, we have some T.P. 83 00:08:59,850 --> 00:09:02,330 Let's go back and fix it. 84 00:09:07,030 --> 00:09:09,100 As A.B. Spellman reports. 85 00:09:09,280 --> 00:09:09,830 OK. 86 00:09:10,270 --> 00:09:10,990 That's right. 87 00:09:11,930 --> 00:09:16,730 Now, let me also add my e-mail passwords here. 88 00:09:19,510 --> 00:09:20,890 Now, let's combine it. 89 00:09:33,310 --> 00:09:41,920 OK, now done combining the next step is uploading the code to our E.S.P board and see if the email 90 00:09:41,920 --> 00:09:43,120 is sent or not. 91 00:09:43,330 --> 00:09:46,750 Now, we will do this in the next lesson, but that's it for this lesson. 92 00:09:46,750 --> 00:09:50,370 If you have any questions, please ask in the Q&A board. 93 00:09:50,920 --> 00:09:53,770 This is Ashara from educational engineering team.