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
 SQL Server Development (2000)
 DTS Error when sending CDOSYS mail

Author  Topic 

rudeboy
Starting Member

3 Posts

Posted - 2009-07-10 : 17:52:12
Using DTS to populate an excel spreadsheet then send it as an attachment via email. Works fine on the old server but generates an error when run on the new server (which appears to be configured the same as the old server). The following error is generated:

Error Code: 0
Error Source= CDO.Message.1
Error Description: The "SendUsing" configuration value is invalid.


Here is the code from the ActiveX Script Task if that helps:

Function Main()

Dim objExcel, objWB, objSheet, rowNum
Dim objMail

' Open and check the spreadsheet for data
Set objExcel = CreateObject("Excel.Application")
Set objWB = objExcel.Workbooks.Open("C:\Threshold Quantity Data\F-PG Restock.xls")
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)

rowNum = objSheet.UsedRange.Rows.Count

' Close the workbook and exit the application.
objWB.Close
objExcel.Quit

set objWB = Nothing
set objExcel = Nothing

' Don't send the data file if it only contains a header row (column names)
If(rowNum > 1) Then
Set objMail = CreateObject("CDO.Message")
With objMail
.From = "<email address here>"
.To = "<email address here>"
.Bcc = "<email address here>"
.Subject = "Regina PG - Parts List For Reorder"
.Textbody = "The Available Quantity of some parts is equal to or less then the Quantity Threshold. Please review the attached file."
.AddAttachment("file://C:\Threshold Quantity Data\F-PG Restock.xls")
.Send
End With
Set objMail = nothing
End If

Main = DTSTaskExecResult_Success
End Function


I've checked this forum and other posts but have not seen anything that might explain what happened, or how to correct the problem. Help would be greatly appreciated.
   

- Advertisement -