Link to home
Start Free TrialLog in
Avatar of Member_2_7969381
Member_2_7969381

asked on

SSIS : Send Mail Task Error: File doesn't exist or you don't have permission.

I was trying to attach LOG files in send mail task. I have multiple log files to attach. When I use direct path to attach file, It works but when I use variable, it's giving me error. I am using following expression with user variable. I also set Delay Validation = True.

@Log_File_Attachment: "\\\\ServerName\\Drive$\\Folder 1\\Folder 2\\Folder 3\\*.log"

Please correct me where I am mistaking.
Avatar of zephyr_hex (Megan)
zephyr_hex (Megan)
Flag of United States of America image

Instead of #.log, have you tried one specific file?

@Log_File_Attachment: "\\\\ServerName\\Drive$\\Folder 1\\Folder 2\\Folder 3\\MyLog.log"
Avatar of Manju
Click on the expressions tab (on the left of the Send Mail task editor) and expand/click on the ellipsis on the Expressions box on the right.  Select the "FileAttachments" property and type in @[User::filename] into the Expression box.
ASKER CERTIFIED SOLUTION
Avatar of Member_2_7969381
Member_2_7969381

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
If you resolved the problem, you can close out the thread and select your own post as the solution.
Avatar of Member_2_7969381
Member_2_7969381

ASKER

Thanks to all