Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asptoday_discuss thread: Sending Mail from DTS package using ActiveX Script


Message #1 by "Michael Bell" <michaeljbell@b...> on Fri, 12 Apr 2002 12:46:50
Hi

I have created a DTS package in SQL server 2000 which uses an active X 
script task to retrieve user information from a db. This works fine.

The problem comes when I attempt to use CDONTS from within the active x 
script to forward a mail to each user.

The package does execute successfully but no mail is sent through the 
system.

I am creating the mail object as follows:

Dim objEmail
Set objEmail = CreateObject("CDONTS.NewMail")

Once done I set the relevant properties and execute the send method of the 
object.

I have no problems sending a mail from within an ASP page using similar 
syntax.

The server runs Win 2K Server OS.

Any help much appreciated.

Thanks
Michael
Message #2 by "Kyle" <Kyle@T...> on Fri, 12 Apr 2002 07:54:09 -0400
Michael,

Here is an ActiveX script task to send an email that I cut and pasted
from one of my DTS packages and it works well.  You probably already
have this part as it is pretty straight forward.  What I would guess to
be your problem is how your server is configured to send mail.  Try
looking in that area and sending mail separately from the ActiveX
script.

Function Main()
	Dim objMail
	Set objMail =3D CreateObject("CDONTS.NewMail")
	objMail.From =3D "FSI_Cube_Processing"
	objMail.Subject =3D  "FSI Cube Processing - Build Purchaser St
City Zip Dimension Failed"
	objMail.To =3D "Kyle@T..."
	objMail.Body =3D "FSI Cube Processing - Build Purchaser St City
Zip Dimension Failed"
	objMail.Send
	set objMail =3D nothing
	Main =3D DTSTaskExecResult_Success
End Function

Kyle

-----Original Message-----
From: Michael Bell [mailto:michaeljbell@b...]
Sent: Friday, April 12, 2002 8:47 AM
To: ASPToday Discuss
Subject: [asptoday_discuss] Sending Mail from DTS package using ActiveX
Script

Hi

I have created a DTS package in SQL server 2000 which uses an active X
script task to retrieve user information from a db. This works fine.

The problem comes when I attempt to use CDONTS from within the active x
script to forward a mail to each user.

The package does execute successfully but no mail is sent through the
system.

I am creating the mail object as follows:

Dim objEmail
Set objEmail =3D CreateObject("CDONTS.NewMail")

Once done I set the relevant properties and execute the send method of
the
object.

I have no problems sending a mail from within an ASP page using similar
syntax.

The server runs Win 2K Server OS.

Any help much appreciated.

Thanks
Michael

  Return to Index