This topic is locked

Send Email to Group

11/20/2008 7:23:22 PM
ASPRunnerPro General questions
M
mccreelake author

Hello,
Can you tell me how to write VBscript that would e-mail a selected group of people from a table after a record is added or some other event?

J
Jane 11/21/2008

Hi,
use Send simple email action as a sample on the Events tab.

To select emails from another table use following code:

str = "select EmailField from AnotherTableName"

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection

all_emails = ""
while not rstmp.eof

all_emails = all_emails & rstmp("EmailField") & ","

rstmp.Movenect

wend
all_emails = left(all_emails,Len(all_emails)-1)

rstmp.close

set rstmp=nothing