Faqts : Computers : Programming : Languages : Asp : ASP/VBScript : Common Problems

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 6 people (67%) answered Yes
Recently 2 of 4 people (50%) answered Yes

Entry

I have a database of 100 clients out of which I want to send email to 12 selected clients only using aspemail pls tell me how to do it?

Aug 22nd, 2001 03:39
Simon Burnett, Preeti Sikri,


First create an SQL string and get a recordset of the clients you wish 
to email:
strSQL = "SELECT client_name, client_email" & _
  "FROM tblClients WHERE client_account > 1000"
objRSClients.Open strSQL, objConn
Then create the disribution list:
While not objRSClients.EOF
  strDList = strDlist & objRSClients("client_email") & ";"
Wend
Then create your email object:
set objMail = Server.CreateObject("CDONTS.Newmail")
objMail.To = strDList
objMail.Subject = "My Subject Line"
objMail.Body = "The lovely text i am sending"
objMail.BCC = "me@me.com" ' for testing maybe
objMail.Send ' Off it goes.
set objMail = nothing
Hope this gives you the general idea.



© 1999-2004 Synop Pty Ltd