Skip to Content
0

attach file for failed data

Sep 11, 2017 at 09:13 AM

60

avatar image
Former Member

Hi,

Scenario....

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.

Thanks

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
1

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.

Regards

Chaitanya

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

Thanks for your reply Chaitanya.

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

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 = "no-reply@yourcompany.com"
strSMTPTo = "helpdesk@yourcompany.com"
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("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPRelay
oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMessage.Configuration.Fields.Update

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

oMessage.Send

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 = " jyoti.deka@abc.com"

strSMTPTo = " ravi@abc.com"

0

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

0