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.
VBdotnet2005Asked:
Who is Participating?
 
carsRSTCommented:
Check your property within the expression of the send mail task.  Specifically check that you're setting the "SmtpConnection" property to your variable.
0
 
vdr1620Commented:
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
0
 
carsRSTCommented:
Try changing...
@[users::Targetfile]

To
@[user::Targetfile]

should be singular
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
VBdotnet2005Author Commented:
"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]
0
 
vdr1620Commented:
can you post your expression and the Task using this variable.. also,u r default value in the variable
0
 
VBdotnet2005Author Commented:
see attachment
ee.bmp
0
 
carsRSTCommented:
You need to put your variable in the "expressions" section of the properties, not the "attachments" area.
0
 
VBdotnet2005Author Commented:
see attachment
ee.bmp
0
 
carsRSTCommented:
Sorry - only put in "expressions" area.  When it validates, it's checking that attachments and doesn't know what to do.
0
 
carsRSTCommented:
So just remove your variable from the attachments property area.  
0
 
carsRSTCommented:
Couldn't tell from the pic, but make sure you're setting the correct property within the expression.  Should be FileAttachments.
0
 
vdr1620Commented:
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
0
 
vdr1620Commented:
Also select the Send mail task and in properties ---> change Delay Validation --TRUE
0
 
VBdotnet2005Author Commented:
Ok that works. Please see error below. Please let me know if I need to open a new question for this.
ee.bmp
0
 
VBdotnet2005Author Commented:
see attachment
ee.bmp
0
 
vdr1620Commented:
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)
0
 
VBdotnet2005Author Commented:
Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.