Re: [Emerald] rebatch behind the scenes .... ?

Dan Tang ( (no email) )
Thu, 10 Jun 1999 21:40:33 +0800

A store procedure in SQL 7.0 for you

declare curMailer INSENSITIVE cursor
for select email,firstname,lastname
from subaccounts
where datalength(email)>0
declare @email varchar(50)
declare @FirstName varchar(50)
declare @lastName varchar(50)
declare @MsgBody varchar(2000)

open curMailer
fetch next from curMailer into @email,@firstname,@Lastname
while @@FETCH_STATUS=0
begin
Select @MsgBody='Dear ' + @FirstName + ' ' + @LastName + ',' + char(13)
select @MsgBody='Your main message here' + char(13) + char(13)
select @MsgBody='Regards,'+ char(13) + char(13)
select @MsgBody='Your title'
exec master..xp_sendmail @recipients=@email,
@subject='Your subject',
@Message=@MsgBody
fetch next from curMailer into @email,@firstname,@Lastname
end
close curMailer
deallocate curMailer

To test it, run this on SQL7.0 QueryAnalyzer, replace @email the
@receipients=@email with your email address like that
'yourmail@yourdomain.com'.

Because this is a store procedure, you can acctually set up a ASP page,
which you can type in the message and let the Web Server and SQL 7.0 handle
the rest.

Regards,

Dan Tang
Network Operation
Domain Internet Access
---------------------------------------------------
Sign Up a Dial up account at http://isp.dmn.com.au and get connect right
now.
---------------------------------------------------
Join the Emerald ASP Addon Product mailing list
by sending email to emerald-request@dmn.com.au with message body SUBSCRIBE
only

-----Original Message-----
From: Alexander Blauvelt <online@olg.com>
To: emerald@iea-software.com <emerald@iea-software.com>
Date: Wednesday, June 09, 1999 11:40 PM
Subject: Re: [Emerald] rebatch behind the scenes .... ?

>> Might I suggest if this is to happen that it's not a feature enabled by
>> default :^)
>>
>> Most banks would at best kick you up the ass for "guessing" CC expiry
dates,
>> and some will withdraw merchant facilities...
>
>OUCH. That i didn't know. Perhaps we could have a script that
>emailed the customer to please call with new credit card information.
>Unfortunately I don't know enough about sql server and scripting to be
>able to do this. Anyone have an idea on how this could be done ?
>
>
>Alex
>Online Gateway
>