Skip to Content
avatar image
Former Member

attach file for failed data



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.


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

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.



    Add comment
    10|10000 characters needed characters exceeded

  • 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


    Add comment
    10|10000 characters needed characters exceeded