Skip to Content

attach file for failed data

Sep 11, 2017 at 09:13 AM


avatar image
Former Member



I have a job with the validation transformation where I have check the validation and send data to pass table if the logic satisfied and send to fail table if the logic fails. Now i have to generate a file for the failed data table and send the file to user using smtp_to. How i can achieve this.


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Sep 11, 2017 at 02:38 PM

Hi Jyoti,

smtp_to or mail_to functions will not support for sending the file as attachment or not even HTML formatting of message body.

You may need to write some VB script and then call the same using exe function from scripts.



Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks for your reply Chaitanya.

Ravi kiran Pagidi Sep 12, 2017 at 01:01 PM

Hi Jyoti Deka,

Please use below VB script and save it with .vbs extension and use this "exec(‘cscript’,'[$G_LOCATION]\email.vbs’, 8); " in BODS script

strSMTPFrom = ""
strSMTPTo = ""
strSMTPRelay = "smtp relay server name or IP address"
strTextBody = "Body of your email"
strSubject = "Subject line"
strAttachment = "full UNC path of file"

Set oMessage = CreateObject("CDO.Message")
oMessage.Configuration.Fields.Item("") = 2
oMessage.Configuration.Fields.Item("") = strSMTPRelay
oMessage.Configuration.Fields.Item("") = 25

oMessage.Subject = strSubject
oMessage.From = strSMTPFrom
oMessage.To = strSMTPTo
oMessage.TextBody = strTextBody
oMessage.AddAttachment strAttachment


Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Ravi,

Thanks for your reply. I was busy with job automation work. Please help me to resolve

do I have to change the below line

IstrSMTPFrom = ""

strSMTPTo = ""


IstrSMTPFrom = give email address from which you are sending email alerts or the email that is registered in SMTP.