I have the following code to send email using DTS and CDO objects.
I am getting run time error. Dont know why ?
Any configurations to be made ?
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
dim sch
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig =CreateObject("CDO.Configuration")
cdoConfig.Fields.Item(sch & "sendusing") =2
cdoConfig.Fields.Item(sch & "smtpserver") = MPBAKOREX01.corp.mphasis.com"
cdoConfig.fields.update
Set cdoMessage =CreateObject("CDO.Message")
Set cdoMessage.Configuration = cdoConfig
cdoMessage.From = "shanmuga.r@.mphasis.com"
cdoMessage.To = "shanmuga.r@.mphasis.com"
cdoMessage.Subject = "Sample CDONTS NewMail"
cdoMessage.HTMLBody="<html><b>rajaganapathy</b></html>"
msgbox "before "
cdoMessage.Send
msgbox "Send"
Set cdoMessage = Nothing
Set cdoConfig = Nothing
Main = DTSTaskExecResult_Success
End Function
hi RajaGanapathy,
What sort of error you see? COM error?
From a .dtsx file or DTS 2000?
|||Hi,
Creating a new instance of "CDO.Configuration" requires a dll to be registered on the server. Is the dll available on the server. Also please specify the error.
Thanks
Mohit
|||Thanks enric vives and mohtigupta,
Even i can use xp_sendmail, but i cant send in htmlformat.
I dont think my system is installed with cdo.dll.
Can u just tell me how to send a mail in html format !
|||This forum concerns SSIS, not DTS. However, the DTS newsgroup is still available.
No comments:
Post a Comment