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)
 Sending CDONTS Mail From a Stored Procedure

Author  Topic 

udeleng
Starting Member

5 Posts

Posted - 2001-12-06 : 19:46:59
I have a field and a variable defined as varchar(4000) which I'm using for the body of the email (in HTML format). Before sending the email, I have a series of selects to replace variables sent from an HTML with values from a table, something like this


Select @fname=client_fname
From clients
Where client_id = @client_id
.
.
.
Select @text = replace(@text, '@client_fname', @fname)
.
.
.


In any case, When the email is sent, the email I get is truncated near the end (several characters). I looked in the table, and the data seems just fine. I also have a form setup to edit each record using a textarea and the text there is also complete, no missing characters. Does anyone know what's going on, any one experience anything like this???

Thanks.

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2001-12-06 : 19:52:12
It is probably due to the fact that parameters are truncated at 255 characters.....

stoopid sp_oacreate



Damian

Edited by - merkin on 12/06/2001 19:52:37
Go to Top of Page

udeleng
Starting Member

5 Posts

Posted - 2001-12-06 : 20:03:08
In my batch job, I want to be able to perform several operations on the data. For example, I get email of expired users, and send them email, activate more users and send them mail. I placed the entire job code in a vbs file, but EM wouln't save it because it kept saying that "I didn't close/detroy all object created" (I did, I checked). Is there a way for me to call a vbs file from an SP? I can then use the script to sent the email.

Is it possible to modify sp_oacreate??? Where can I find it?

Thanks.

Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2001-12-06 : 20:09:18
HI

No you can't modify sp_OACreate.
I think there is a bug in scheduling longer VBS scripts, I know that error well. One way I get around it is set up a DTS job that has a scripting step. You can schedule that, or call it using DTSRun from a stored proc.

Hope that helps

Damian
Go to Top of Page

udeleng
Starting Member

5 Posts

Posted - 2001-12-06 : 21:31:08
Thanks for the tip. I'll use DTS.

Go to Top of Page
   

- Advertisement -