Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: CDONTS from scheduled job


Message #1 by "William Milne" <wmilne01@e...> on Wed, 1 Nov 2000 19:50:48 -0000
The following code works fine from ASP. What I want to do is extract

database content from SQL Server 7 on a daily basis using SQL Agent. When

I use this code in a DTS script component run I get the following error:



ActiveX component can't create object 'CDONTS.NewMail'.



Can anyone tell how to use or configure CDONTS to run in this way ?



William Milne



set objSendMail = CreateObject("CDONTS.NewMail")

with objSendMail

	.From = "wmilne01@e..."

	.To = "wmilne01@e..."

	.Subject = "New PRs " & Now()

	.BodyFormat = CdoBodyFormatHTML

	.MailFormat = CdoMailFormatMime

	.Body = "<html><head></head><body>" & s & "</body></html>"

	.Send

end with

set objSendMail = nothing


  Return to Index