I have built a last step (Activex Script Task) in a package that sends email on package completion.
The code is
It parses OK. But on execution of the step, an error message is posted "Fields update failed. For further information, examine the Status property of individual field objects'
The code is
Code:
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
Dim iMsg,iConf,Flds,strHTML
Const cdoSendUsingPort = 25
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 25
.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = "My_SMTP_Server"
.Update
End With
With iMsg
Set .Configuration = iConf
.To = "Headcase@headcasecentral.com"
.From = "Headcase@headcasecentral.com"
.Subject = "Success"
.HTMLBody = "<body>Yes, you can <b>HTML</b> as much as <blink>you</blink> want here</body>"
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
Main = DTSTaskExecResult_Success
End Function
It parses OK. But on execution of the step, an error message is posted "Fields update failed. For further information, examine the Status property of individual field objects'