May 26, 2011 at 6:30 pm
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
May 29, 2011 at 7:59 pm
The solution to this problem was twofold
1. Set the property 'DelayValidation' to true at the package level. The files were being output dynamically and were not there when validated upfront.
2. I failed to include the filepath for the fileattachmant property of the sendmail task.
🙂 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
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply