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)
 DTS and global variables

Author  Topic 

dejjan
Yak Posting Veteran

99 Posts

Posted - 2006-01-19 : 09:27:06
Hello,
I have one sp which brings me a plain text.
declare @str varchar(8000)
exec sp_mail @str output

That text I want to send via mail. For this purpose I use ActiveX Script:

"
Function Main()
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "name@gmail"
objEmail.To = "name@gmail"
objEmail.Subject = "Test"

objEmail.Textbody = ????????

objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"mySMTP"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send

Main = DTSTaskExecResult_Success
End Function
"

My question is, how could I use @str as parameter to be textbody for my mail (objEmail.Textbody = ????????).

I tryied by using global variable 'X' and call it with objEmail.Textbody = DTSGlobalVariables("X").value
But it couldn't work. Or I made some mistakes in defining parameters.

Any help ?
   

- Advertisement -