In this article we are going to see how to send mail from SSIS using SMTP. This send mail is done in real time when the packages are automated and to notify the end user at certain circumstances about the execution process or also about any failure in a process or anything is not done as needed. We have a Send Mail Task option which is used to do it. Let's discuss it in detail.
This article will show how to set the configuration for the send mail option and send a test mail to the end user.
Follow steps 1 to 3 on my first article to open the BIDS project and select the right project to work on an integration services project. Once the project is created, we will see how to use Send Mail Task available with SSIS.
After creating the project, drag and drop the Send Mail Task from the tool box. It will open a pop up as shown in the following screen. It has 3 sections in to do that and we will see how to configure using the options.
General tab: This section has options to give a name and description for the task similar to the one available in common in all the tasks.
Mail tab: This is the very important section in configuration, here we have many otpions we need to configure to make use of sending mail from the SSIS packages. Check the following screen for an example.
You need to give your systems SMTP Server details and from, to and cc mail ids to whoever a mail has to be sent from this package.
When you click on the SMTP new server configuration you will see a window as shown in the following to input the new server details.
Expression tab: This page is used to edit property expressions and to access the Property Expressions Editor and Property Expression Builder dialog boxes.
After configuring everything we can run the application and see how the mail is sent using SSIS package as shown in the following figure. Running the package will send a mail to the recipients and execute the package successfully.
So this article helps you to do a send mail task which is very necessary for a package to execute automatically and send a result to the end users.