CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 How to send a record to several e-mail address like a list (e-mail address are in a table)

Print topic Send  topic

Author Message
Nido
Posted: 08/18/2001, 6:54 PM

Clear DayHello All,

Before I submit a request to Code Charge Support, I thought I better try it
with the discussion board first.
I am using CC 2.0 Beta 5 with ASP 2.0

Project/Problem:

In a SQL 6.5 database, We have two tables tblNEWS and tblCLIENTS. tblNEWS
contains daily updated report (news) of our corporation. tblCLIENTS
contains the list of our important clients. tblCLIENTS has only three
fields, fldClientID, fldClientNAME and fldClientEMAIL

We want to send daily news (one selected record from tblNEWS) to our clients
via e-mail using CDONTS. How can we send the this one news record to
everybody in tblCLIENTS table)? i.e. like sending mail to a list.

I've seen the example TELLAFRIEND which is a great example of CDONTS but
this example gives you text box for your friend's name and e-mail address,
you type the friends name and e-mail address and it sends the mail to
friend. Instead of static text box we want to send the email dynamically to
everybody in the tblCLIENTS using fldClientEMAIL field.

By the way I am using ASP 2.0 (no templates)

Any help would be appreciated. Regards, NIDO


CodeCharge
Posted: 08/18/2001, 11:26 PM

Your request is an almost exact description of the email feature on
GotoCode.com web site, which you may download in CodeCharge format at
http://support.codecharge.com/bulletins.asp
There is an email function in "Modules" section that allows you to send
emails to all people in a table or query. You may also learn how to send
HTML and text emails, allow users to subscribe/unsubscribe, etc.
Some VBScript coding is required but it's all there if you take your time.

The only difference is that GotoCode is customized for use with
ASP&Templates (and PHP&Templates), which you may consider taking an
advantage of, because then you can email users CodeCharge-generated page in
HTML format.

Adam


"Nido" <navcan@hotmail.com> wrote in message
news:9ln680$6pe$1@news.codecharge.com...
> Clear DayHello All,
>
> Before I submit a request to Code Charge Support, I thought I better try
it
> with the discussion board first.
> I am using CC 2.0 Beta 5 with ASP 2.0
>
> Project/Problem:
>
> In a SQL 6.5 database, We have two tables tblNEWS and tblCLIENTS. tblNEWS
> contains daily updated report (news) of our corporation. tblCLIENTS
> contains the list of our important clients. tblCLIENTS has only three
> fields, fldClientID, fldClientNAME and fldClientEMAIL
>
> We want to send daily news (one selected record from tblNEWS) to our
clients
> via e-mail using CDONTS. How can we send the this one news record to
> everybody in tblCLIENTS table)? i.e. like sending mail to a list.
>
> I've seen the example TELLAFRIEND which is a great example of CDONTS but
> this example gives you text box for your friend's name and e-mail address,
> you type the friends name and e-mail address and it sends the mail to
> friend. Instead of static text box we want to send the email dynamically
to
> everybody in the tblCLIENTS using fldClientEMAIL field.
>
> By the way I am using ASP 2.0 (no templates)
>
> Any help would be appreciated. Regards, NIDO
>
>
>

Christian Garnir
Posted: 08/19/2001, 12:42 AM

NIDO,

here is an example i use to send a newsletter to members of my list.
u wil have to change the database and request.form fields to reflect yours.
If u have problems let me know
Chris

<%
'our constants
Const adOpenKeyset = 1
Const adLockReadOnly = 1
Const adCmdTable = &H0002
'our variables for the email and for our objects
Dim strTo , strFrom , strSubject , strBody , objCDONTS , objRS , objConn
'get the results from the create newsletter form
strFrom = Request.Form("from")
strSubject = Request.Form("subject")
strBody = Request.Form("message")
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DBQ=" & Server.MapPath("newsletter.mdb")& ";Driver={Microsoft
Access Driver (*.mdb)}"
Set objRS = Server.CreateObject("ADODB.RecordSet")
objRS.Open "email" , objConn ,adOpenKeyset ,adLockReadOnly,adCmdTable
'just a message to the admin
Response.Write ("Newsletters are being created")
response.Write ("<br>")
'loop through entries
While not objRS.EOF
'create an instance of the CDONTS object
Set objCDONTS = Server.CreateObject("CDONTS.NewMail")
'set objCDONTS various properties
objCDONTS.From = strFrom
objCDONTS.To = objRS("email")
objCDONTS.Subject = strSubject
objCDONTS.Body = strBody
objCDONTS.Send
Set objCDONTS = Nothing
'print message for every entry
Response.Write ("message sent to " & objRS("email") & "<br>")
'move to next entry in database
objRS.MoveNext
Wend
'message to admin saying creation has completed
Response.Write ("newsletter creation completed ")
%>
"Nido" <navcan@hotmail.com> wrote in message
news:9ln680$6pe$1@news.codecharge.com...
> Clear DayHello All,
>
> Before I submit a request to Code Charge Support, I thought I better try
it
> with the discussion board first.
> I am using CC 2.0 Beta 5 with ASP 2.0
>
> Project/Problem:
>
> In a SQL 6.5 database, We have two tables tblNEWS and tblCLIENTS. tblNEWS
> contains daily updated report (news) of our corporation. tblCLIENTS
> contains the list of our important clients. tblCLIENTS has only three
> fields, fldClientID, fldClientNAME and fldClientEMAIL
>
> We want to send daily news (one selected record from tblNEWS) to our
clients
> via e-mail using CDONTS. How can we send the this one news record to
> everybody in tblCLIENTS table)? i.e. like sending mail to a list.
>
> I've seen the example TELLAFRIEND which is a great example of CDONTS but
> this example gives you text box for your friend's name and e-mail address,
> you type the friends name and e-mail address and it sends the mail to
> friend. Instead of static text box we want to send the email dynamically
to
> everybody in the tblCLIENTS using fldClientEMAIL field.
>
> By the way I am using ASP 2.0 (no templates)
>
> Any help would be appreciated. Regards, NIDO
>
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.