I grabbed a snippet of code from this forum to send e-mail from a DTS package via ActiveX script. The script is shown below.
I have a package with one task (ActiveX Script task). When I execute the package I get the following error but yet I receive the e-mail just fine:
I have a package with one task (ActiveX Script task). When I execute the package I get the following error but yet I receive the e-mail just fine:
Code:
Error:
The task reported failure on execution
Multiple-step OLE DB operation generated errors
Check each OLE DB status value, if available, no work was done
Code:
Function Main()
Dim myMail
Set myMail=CreateObject("CDO.Message")
myMail.Subject = "New AgeIn Load"
myMail.From = "admin@mycompany.com"
myMail.To = "me@mycompany.com"
myMail.TextBody = "Enter Your Message Here, "
myMail.Configuration.Fields.Item ("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 2
myMail.Configuration.Fields.Item ("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = "smtp.mycompany.com"
myMail.Configuration.Fields.Item ("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] = 25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
If ErrorCount <> 0 Then
Main = DTSTaskExecResult_Success
Else
Main = DTSTaskExecResult_Failure
End If
End Function