Solved

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

Posted on 2016-07-26
6
26 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 (Megan)
ID: 41730172
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
ID: 41733183
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
ID: 41733708
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 (Megan)
ID: 41811665
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
ID: 41863838
Thanks to all
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Parse field in SQL View 15 99
SQL Server Deadlocks 12 51
How to use left join to take all data from master table? 11 51
sql server group by every 2hrs 5 21
Lessons learned during ten years of interviewing for SQL Server Integration Services (SSIS) and other Extract-Transform-Load (ETL) contract roles and two years of staff manager interviewing contractors.
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…
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

863 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

23 Experts available now in Live!

Get 1:1 Help Now