Send List of Files from A Folder as Email by using Send Mail Task- SQL Server Integration Services (SSIS) Tutorial

Scenario:

We receive different files in one of the folder. Before we start our loading process, we have a requirement to send all the file names in the email to our team by using SSIS Package.

Solution:

In this video we will be able to solve above scenario, we will be using following components of SSIS Package 

  1. How to Create Parameters for Folder Path, EmailTo and EmailFrom
  2. How to use For-each Loop Container to loop through all the file in a folder
  3. How to use ReadOnlyVariables and ReadWrite Variables in Script Task
  4. How to create list of list and save into a variable
  5. How to use Expressions in Send Mail Task for MessageSource( Body), LineTo and FromLine


Code used in the Script 
Dts.Variables["User::FileNamesList"].Value = Dts.Variables["User::FileNamesList"].Value.ToString() + Dts.Variables["User::FileName"].Value.ToString() + "\r\n";


Expressions used in the Video

Subject :
@[System::PackageName]+ " Package completed successfully in Prod"

Expression for Message Source:
"Hi Team
Please find the list of File name in Input Folder \n "+
 @[User::FileNamesList]+"

Thank you
Tech Brothers"



How to Email file names from a Folder by using Send Mail Task in SSIS Package - SSIS Tutorial



  Related Posts/Videos on Send Mail Task  

1 comment:

  1. When choosing email marketing, many entrepreneurs start using a tool to track the actions of sent emails. In this regard, I want to share with you the article https://roboticsandautomationnews.com/2023/01/31/are-email-trackers-legal/59732/ about the legality of using email trackers. In fact, such a tool is very useful for businesses, but you will only be able to track recipient activity on emails that you send. Therefore, it is a perfectly legitimate solution for successful marketing.

    ReplyDelete