 Hello, welcome to SSUnitech social decide and this is continuation of SSIS tutorial. So today we gonna discuss about send mail task. So how we can send the mail by using SSIS package. So here we have different different ways by which we can send the mail. So first is by using send mail task and second is by using script task. So we have certain limitations while we gonna use send mail task. So let's have a look of limitations of send mail task. So our first limitation is the two CC and BCC lines are limited to 256 characters and second is it allow us to send only text enable files and we cannot send HTML file formats. So it's not possible to send while we gonna use send mail task. And next is authentication would be fixed while we gonna create SMTP connection manager. So these are the limitations that's why I would like to avoid use this send mail task. So this is useless. We can use script task for the same. So how we can use the script task. So go to SSDT to implement the package and send the mail. So here let me create one more package. Then call this package as send mail that is fine. So here we have script task. So let me drag and drop this script task then double click on this script task. So here go to one edit script. So here we need to specify our code as I have already written the code. So let me copy the code then we can paste it here. So here we need to specify name spaces. So first name space would be system.net.mail that is fine. And second name space would be system.net. So these two name spaces we have to specify. So here we have specified sender mail id in this sender variable and then this is our recipient mail id. So we have to initialize in this recipient variable. So we want to send mail from this mail id to this mail id. So here our sender and recipient both are same. In real time it would be different. Here we need to specify SMTP. So I gonna send mail via using gmail. So I gonna specify smtp.gmail.com. Then I have specified what would be the mail body in this variable. Then if we want to attach some file then we can use this class which is attachment and this is our object which we are creating. Then here we need to specify our file path where our actual file exist. So this is our file. So this file is going to load in this attachment. After that if we have more than one attachment then we can enable this and we can add in a new object of this attachment. Then this is our mail message. So in this message first we have specified sender, then recipient, then attachment file and last body. So this is initialized in this message type object. So here I would like to create object of this SMTP client. So in my case I wanna use gmail. So our port would be 587. In your case it would be different. So here we can enable our SSL so that is true that is fine. Then I gonna use default credentials false because I would like to specify our credential. So here I would like to specify my credential that's why it's false. Then in network credential I have specified credentials then so here we need to specify our sender's mail ID and then the password. Then we need to add the attachment of this message. So here we need to use message.attachment.add then the object of the attachment. So this is our first and this is our second so I would like to use that one. So these two attachment would be added in our mail. After that here we want to send the mail by this message. So let me save this and close it. Now click on OK. So here I would like to execute our package. The package executed successfully. Now we can stop this package then go to one browser and here as we can see we are getting the attachment file. So this is our attachment file and this is our body which we have specified and here we have two attachments. So this is script one and this is script two. So I hope you have understand how we can send the mail by using script task. So thank you so much for watching this video. If you like this video please subscribe our channel to get many more videos. Don't forget to press the bell icon to get the notification of our newly uploaded videos. Thank you so much.