Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send Mail VB Script Error

Status
Not open for further replies.

Zurich98

Programmer
Apr 8, 2006
64
0
0
US
I'm connecting to SQL 2005 through 2000 Enterprise Manager to create a DTS package to send multiple files as an attachment in one email. The following script worked in SQL 2000. However, I got an error message when connecting to SQL 2005:

Error Source: Microsoft Data Transformation Services(DTS) Package
Error Discription: Error Code 0
Error Source: Microsoft VBScript compilation error
Error Description: Syntax erorr

Error on Line 11

do i need to install any specific component on SQL 2005 in order for this script to work. Your help/suggestion is greatly appreciated.

Thanks


Option Explicit
'**********************************************************
' Visual Basic ActiveX Script
'**********************************************************

Function Main()

Dim objNewMail

Set objNewMail = CreateObject("CDONTS.NewMail")

Call

objNewMail.AttachFile("C:\FileSend\Order Summary.xls", "Order Detail.xls", "Order Statistics.xls", "Order Quarterly 102907.pdf")

objNewMail.Send "jsmith@juno.com",
"dschumaker@yahoo.com;bryan@hotmail.com",
"Daily Report", " Attached is the daily report files."

Set objNewMail = Nothing

Main = DTSTaskExecResult_Success

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top