The aim is to email a list of files in a network folder to a single email destination, one email for each file.
I have a ForEach Loop Container that reads a list of files in the directory and outputs the result to a variable [Files_In_Folder].
Within the container is a sendmail task that uses [Files_In_Folder] in an expression for the FileAttachment property.
I am building the package in SQL Server Business Intelligence Studio. When I built the package it completed successfully and emails all the files as expected...one email for each file.
The problem is that when I close SSBIS and then reopen and attempt to execute the package, it fails with a permission problem.
Error - [Send Mail Task] Error: Either the file "Manager_50000335_20110527.csv" does not exist or you do not have permissions to access the file. This file does exist and I do have permisions to it.
When I remove the expression built for the FileAttachment property of the Sendmail task, it works again. So the issue is around the file attachment, but I am stumped at this point.
🙂 What gets us into trouble is not what we don't know, it's what we know for sure that just ain't so....Mark Twain