Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 CDO SendUsing Mail Failure

Author  Topic 

drdexter33
Starting Member

12 Posts

Posted - 2005-05-05 : 10:50:10
Hello.

I have a DTS package with an ActiveX Script Task that sends an email on success of some data transfer.

The thing that's baffling me is that the package runs on test, however when I transferred it to the production server I keep getting the following error:

ERROR:
------------------------------------------------------------------------------
Step Error Source: Microsoft Data Transformation Services (DTS) Package
Step Error Description:Error Code: 0
Error Source= CDO.Message.1
Error Description: The "SendUsing" configuration value is invalid.

Error on Line 28
Step Error code: 800403FE
Step Error Help File:sqldts80.hlp
Step Error Help Context ID:4500
------------------------------------------------------------------------------

'********************************************************************
' ACTIVEX SCRIPT
'********************************************************************
Function Main()


'on error resume next
dim strEmailBody
dim objMail
dim objResults
dim strToMailAddress
strToMailAddress = DTSGlobalVariables("gToMailAddress").value
set objMail = CreateObject("CDO.Message")

'-------------------------------------------------------------------
'BODY OF MAIL
'-------------------------------------------------------------------
strEmailBody = "Access Plus ZipRing DTS SUCCEEDED" & vbcrlf & _
"Time of the SUCCESS is: " & Time



objMail.to=strToMailAddress

objMail.subject="Access Plus ZipRing DTS Report"
objMail.FROM = "dts@automated-health.com"
objMail.TextBody =strEmailBody <---------------------------LINE 28
objMail.Send


Main=DTSTaskExecResult_Success

End Function
------------------------------------------------------------------------------
I think there's a permissions problem but I still can't pin it down.

Any Ideas?

THanks!

Doug

THNQdigital
Starting Member

15 Posts

Posted - 2005-05-05 : 13:35:09
before objMial.Send, try this,

("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "your smtp server name"

objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMail.Configuration.Fields.Update
'then hit the send
objMail.Send
Go to Top of Page

drdexter33
Starting Member

12 Posts

Posted - 2005-05-05 : 14:14:17
The first line is just this?


("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

or this:

objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Go to Top of Page

drdexter33
Starting Member

12 Posts

Posted - 2005-05-05 : 14:30:39
Now I'm getting this error:

Step Error Source: Microsoft Data Transformation Services (DTS) Package
Step Error Description:ActiveX Scripting encountered a Run Time Error during the execution of the script.
Step Error code: 800403FE
Step Error Help File:sqldts80.hlp
Step Error Help Context ID:4500

Again, it is running when I execute the package, just NOT when the package is running UNDER THE SCHEDULER.

Here is the MODIFIED SCRIPT:
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************

Function Main()


'on error resume next
dim strEmailBody
dim objMail

dim objResults

dim strToMailAddress
strToMailAddress = DTSGlobalVariables("gToMailAddress").value
set objMail = CreateObject("CDO.Message")

'-------------------------------------------------------------------
'BODY OF MAIL
'-------------------------------------------------------------------
strEmailBody = "Access Plus ZipRing DTS SUCCEEDED" & vbcrlf & _
"Time of the SUCCESS is: " & Time



objMail.to=strToMailAddress
objMail.subject="Access Plus ZipRing DTS Report"
objMail.FROM = "dts@automated-health.com"
objMail.TextBody =strEmailBody

dim oConfig
Set oConfig = CreateObject("CDO.Configuration")
Set oFields = oConfig.Fields


With oFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update

End With







objMail.Send

Main=DTSTaskExecResult_Success


End Function


Go to Top of Page
   

- Advertisement -