SendMail Task in SSIS

  • Hello,

    I have a package which is succesfully executing, recently I added a sendmail task for sending generated files as attachments. My attachments will be of this format.

    commonname_20080916.txt, commonname_20080917.txt and so on.

    How can I send the generated file in email as attachment?

    if I am sending email today, todays file only should attach. please direct me.

    Thanks

    rsk

  • Use expression to generate the filepath. Go to Expressions->FileAttachements in the SendMail Task Editor and use the following expression. Change the servername and foldername accordingly

    "\\\\ServerName\\FolderName\\FileName_" + (DT_WSTR, 4) DATEPART("yyyy",getdate()) +

    RIGHT("00" + (DT_WSTR, 4) DATEPART("mm",getdate()) ,2) + RIGHT("00" + (DT_WSTR, 4) DATEPART("dd",getdate()) ,2) + ".txt"

    HTH

    ~Mukti

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply