Solved

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

Posted on 2016-07-26
6
24 Views
Last Modified: 2016-10-28
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.
0
Comment
Question by:Member_2_7969381
  • 2
  • 2
6 Comments
 
LVL 42

Expert Comment

by:zephyr_hex
Comment Utility
Instead of #.log, have you tried one specific file?

@Log_File_Attachment: "\\\\ServerName\\Drive$\\Folder 1\\Folder 2\\Folder 3\\MyLog.log"
0
 
LVL 6

Expert Comment

by:Manju
Comment Utility
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.
0
 

Accepted Solution

by:
Member_2_7969381 earned 0 total points
Comment Utility
Created 2 variables : Log_File & Log_Files

I completed this task by adding Script task with below command line.

Dts.Variables["User::Log_Files"].Value = Dts.Variables["User::Log_Files"].Value.ToString() + "|" + Dts.Variables["User::Log_File"].Value.ToString();

Thanks
0
 
LVL 42

Expert Comment

by:zephyr_hex
Comment Utility
If you resolved the problem, you can close out the thread and select your own post as the solution.
0
 

Author Comment

by:Member_2_7969381
Comment Utility
Thanks to all
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how the fundamental information of how to create a table.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now