Link to home
Start Free TrialLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

asked on

Send mail Task - attachment

I created a variable call Targetfile, scope is package, data is string, value is myfilelocation
In Send Mail Task Editor, Attachments, I added @[users::Targetfile], in Expression  where it say name, I selected @[users::Targetfile]
It keeps saying "either the file @[users::Targetfile] does not exist or you don't have permission....???
Need help.
Avatar of vdr1620
vdr1620
Flag of United States of America image

It looks like the account used by SSIS does not have permissions to the Folder where the file is being stored. check permissions on the Folder.. I would also suggest you to check the file path also,copy thee result of the expression as is and try to run/open it from RUN
Try changing...
@[users::Targetfile]

To
@[user::Targetfile]

should be singular
Avatar of VBdotnet2005

ASKER

"It looks like the account used by SSIS does not have permissions to the Folder where the file is being stored."

I can run it fine when I don't use variable. I confirm the path and file name is correct. Is there another way to check this?
I run it under my logon.  I also changed to @[user::Targetfile]
can you post your expression and the Task using this variable.. also,u r default value in the variable
see attachment
ee.bmp
You need to put your variable in the "expressions" section of the properties, not the "attachments" area.
see attachment
ee.bmp
Sorry - only put in "expressions" area.  When it validates, it's checking that attachments and doesn't know what to do.
So just remove your variable from the attachments property area.  
Couldn't tell from the pic, but make sure you're setting the correct property within the expression.  Should be FileAttachments.
Ok... does this Variable evaluate to the full path of the File..In such a case it should be in written in the File attachments property not the Name...Under expressions tab
fileAttachment.jpg
Also select the Send mail task and in properties ---> change Delay Validation --TRUE
Ok that works. Please see error below. Please let me know if I need to open a new question for this.
ee.bmp
see attachment
ee.bmp
The Smtp Connection variable value should be written under Smtp connection property.. You do need to place any variable the Name property..If you have any variables under this property, delete it.. For configuration you will just need the Connection String property..Value property is not necessary.. Make sure that you  have placed your smtp variable (SMTP connection string properties.. under expressions)
ASKER CERTIFIED SOLUTION
Avatar of carsRST
carsRST
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you