Solved

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

Posted on 2016-07-26
6
44 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 43

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 43

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

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

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

Here's a requirements document template for an integration project (also known as Extract-Transform-Load or ETL) based on my development experience as an SQL Server Information Services (SSIS) developer over the years.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

728 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