?
Solved

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

Posted on 2016-07-26
6
Medium Priority
?
53 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 44

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 44

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

649 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