1 00:00:04,760 --> 00:00:07,570 The A.S.A.P. Library. 2 00:00:07,610 --> 00:00:08,540 Hello, everyone. 3 00:00:08,570 --> 00:00:14,120 Today, we're going to talk about a library called the Asymptotically Library in Eitam. 4 00:00:14,330 --> 00:00:22,730 So obviously this library is usually used to work with the asymptotically protocol and to transmit messages 5 00:00:22,760 --> 00:00:23,760 over the Internet. 6 00:00:24,080 --> 00:00:30,580 So the function that this library uses specifically to transmit messages is called sendmail methods. 7 00:00:30,800 --> 00:00:37,580 So there are few steps that you need to follow in order for you to send an email over Internet using 8 00:00:37,580 --> 00:00:38,870 the same type of protocol. 9 00:00:39,140 --> 00:00:44,430 First of all, you need to use the asymptotic class in order to create an email object. 10 00:00:44,630 --> 00:00:51,350 And here we're going to actually bust the constructor method, which is the hostname. 11 00:00:51,490 --> 00:00:53,650 They we're going to create the mail message. 12 00:00:53,870 --> 00:01:00,200 And finally, we're going to call this a sendmail method that I previously mentioned. 13 00:01:00,500 --> 00:01:05,440 And this in the mail method is already booting into the asymptotically class. 14 00:01:05,660 --> 00:01:12,320 So if you create an object from the A.P. class, you can simply apply this middle is in the email to 15 00:01:12,320 --> 00:01:13,440 the desired receiver. 16 00:01:13,610 --> 00:01:21,860 So if you are not familiar with, for example, who is the host, who is the local host, what ought 17 00:01:21,860 --> 00:01:22,610 we use? 18 00:01:22,640 --> 00:01:26,200 What is the host of the server? 19 00:01:26,240 --> 00:01:28,070 Which one is a local host and so on. 20 00:01:29,180 --> 00:01:30,920 Let's talk a little bit about this. 21 00:01:30,920 --> 00:01:36,330 So the host is the IP address of the asymptotically server. 22 00:01:36,620 --> 00:01:44,510 So actually, if you remember the picture from the previous video, the host is the IP address of the 23 00:01:44,510 --> 00:01:45,170 server. 24 00:01:45,530 --> 00:01:50,570 Then the port is the tunnel between the client and the server. 25 00:01:50,780 --> 00:01:56,140 So in this to twenty five or forty five, we basically establish the connection. 26 00:01:56,420 --> 00:02:03,890 And finally we need the localhost address, which is basically the IP address or in our case, the email 27 00:02:03,890 --> 00:02:08,300 address of the client or the person that is sending the email. 28 00:02:08,540 --> 00:02:14,140 So this is the whole concept between the host port and localhost in here in front of you guys. 29 00:02:14,150 --> 00:02:24,920 I actually provided you with a code that is simply using the async protocol in order to connect to the 30 00:02:25,040 --> 00:02:26,750 different email addresses. 31 00:02:27,080 --> 00:02:34,920 So as you can see first here we import, so we import the same Kippy library. 32 00:02:35,540 --> 00:02:37,280 So this is the first step that we do. 33 00:02:37,670 --> 00:02:41,680 And after we import it now, we can create the asymptotically object. 34 00:02:41,990 --> 00:02:48,710 So here on the next level, we are creating a simple chip name, right. 35 00:02:48,710 --> 00:02:56,740 Aasim type object from the asymptotically class in here. 36 00:02:56,780 --> 00:03:03,620 We're think also we're passing the cost address. 37 00:03:03,890 --> 00:03:12,400 So the Hofstadter's, for example, here is to be at Delta Gmail dot com and then the port for connection. 38 00:03:13,010 --> 00:03:19,990 So in the port for, for a connection in here, which was five hundred and eighty eight. 39 00:03:20,480 --> 00:03:21,740 So this what you do next. 40 00:03:22,010 --> 00:03:32,310 So once we do that now, it is actually very easy to send an email from one e-mail to another so simply 41 00:03:32,310 --> 00:03:34,060 you can use the function sendmail. 42 00:03:34,850 --> 00:03:42,670 So SMPTE pitons in the mail and then you stated the sender, you state of the receiver in your state, 43 00:03:42,710 --> 00:03:44,420 the message that you would like to send. 44 00:03:44,570 --> 00:03:50,450 OK, so here is the actual actual sending the mail. 45 00:03:50,660 --> 00:03:51,180 OK. 46 00:03:51,680 --> 00:03:56,350 And obviously after that you have the SMP exception. 47 00:03:57,620 --> 00:04:01,790 So here's some TV exception. 48 00:04:02,090 --> 00:04:13,610 And the exception is that there were error when sending the message. 49 00:04:13,850 --> 00:04:22,940 OK, so this is why we're doing to try and accept function and then we are creating the asymptotically 50 00:04:22,940 --> 00:04:23,520 protocol. 51 00:04:23,810 --> 00:04:30,890 So this is the basic way for sending mail from local calls to a host, and this is all the steps that 52 00:04:30,890 --> 00:04:32,600 you need to cover in order to do that. 53 00:04:32,930 --> 00:04:38,630 I just wanted to show you how this is done here while the code is simple, because later on I'm actually 54 00:04:38,630 --> 00:04:46,670 going to show you how you can write your own code with your own files so you can see something already 55 00:04:46,670 --> 00:04:49,350 done before jumping into the more complex code. 56 00:04:49,640 --> 00:04:53,450 So just are the basic methods that you're using here. 57 00:04:54,710 --> 00:05:00,770 And so this was everything I want to share with you for today for the same type of protocol. 58 00:05:00,890 --> 00:05:03,170 Also, another interesting thing that I want to. 59 00:05:03,270 --> 00:05:10,320 Share, which was, for example, if you'd like to send the mail too much for response, so let's say 60 00:05:10,320 --> 00:05:17,190 you have a mailing list and you want to send the email to multiple people, you can simply do that by 61 00:05:17,310 --> 00:05:19,460 typing their email with a column. 62 00:05:19,740 --> 00:05:26,640 You can even, for example, write a line called the, let's say, receivers in their type, the emails 63 00:05:26,640 --> 00:05:29,830 of all the people that you would like to send an email. 64 00:05:30,090 --> 00:05:36,240 So, for example, here will be a receiver, one at. 65 00:05:37,400 --> 00:05:39,650 Domain, dot com. 66 00:05:40,020 --> 00:05:52,970 OK, then you can write receiver to put it in parenthesis to a receiver to add domain, dot com and 67 00:05:52,970 --> 00:05:53,420 so on. 68 00:05:53,550 --> 00:06:03,260 And after that, instead of typing to the receiver right here, you can simply write receivers, receivers. 69 00:06:03,710 --> 00:06:13,010 And so in that way, you're basically passing the multiple email lists to the method that is going to 70 00:06:13,010 --> 00:06:13,590 be sent. 71 00:06:13,610 --> 00:06:19,400 It will be the same to them in this section, actually, with practice, if you want to advertise some 72 00:06:19,400 --> 00:06:23,000 of your product to multiple people who keep their email addresses. 73 00:06:24,330 --> 00:06:30,050 So those are the guys I think, that they want to share for you for today. 74 00:06:30,290 --> 00:06:37,520 And in the next video, I'm actually going to show you how you can send an email using the Gmail tool 75 00:06:37,520 --> 00:06:37,820 kit. 76 00:06:38,240 --> 00:06:43,840 And I'm going to login actually to my email and I will show how the system. 77 00:06:44,220 --> 00:06:44,910 That's it. 78 00:06:44,930 --> 00:06:46,530 Thanks very much for watching, guys. 79 00:06:46,550 --> 00:06:50,870 And there with me in the next video, because I promise is going to be very exciting. 80 00:06:51,320 --> 00:06:52,220 Thanks for watching.