CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Send e-mail to list?

Print topic Send  topic

Author Message
news-server
Posted: 07/12/2001, 11:42 AM

Any tips on how I might use CodeCharge to send an e-mail to everyone in a
database? Where do I put the code to send the e-mail?

Rjb

CodeCharge
Posted: 07/12/2001, 12:20 PM

I wrote this ASP code recently, which you can place in Modules/Global
Functions section of CC:

'Send Emails based on SQL query
sub sendemails(email_sql, email_from, email_subject, email_body)
openrs email_rs, email_sql
while not email_rs.EOF
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.From = email_from
objCDO.To = GetValue(email_rs, 0)
objCDO.Subject = email_subject
objCDO.Body = email_body
objCDO.MailFormat = 0
objCDO.Send
set objCDO=Nothing
email_rs.MoveNext
wend
end sub

Then I have a page that allows an adminstrator to enter an email message,
which gets recorded in the database, but in the "After Insert" Event I call
the above function with this code that sends emails to everyone:
'Send emails
'Select only those that match selected member status, or all if the status
is = 0
call sendemails("SELECT email FROM members WHERE email <> """"",
fldemail_from, fldemail_subject, fldemail_body)

My form contains fields: email_from, email_subject, email_body among others.

BTW, we plan to describe the above method in future CC documentation, as it
is an option for everyone to create CodeCharge components (by placing
functions in the Modules section).

Adam S.
YS/CC


"news-server" <you@me.com> wrote in message
news:9ikr2e$dvl$1@news.codecharge.com...
> Any tips on how I might use CodeCharge to send an e-mail to everyone in a
> database? Where do I put the code to send the e-mail?
>
> Rjb
>
>

CodeCharge
Posted: 07/12/2001, 12:24 PM

Correction, one of my comments below is wrong and should be removed:
"'Select only those that match selected member status, or all if the
status is = 0"



"CodeCharge" <support@codecharge.com> wrote in message
news:9iktag$iln$1@news.codecharge.com...
> I wrote this ASP code recently, which you can place in Modules/Global
> Functions section of CC:
>
> 'Send Emails based on SQL query
> sub sendemails(email_sql, email_from, email_subject, email_body)
> openrs email_rs, email_sql
> while not email_rs.EOF
> Set objCDO = Server.CreateObject("CDONTS.NewMail")
> objCDO.From = email_from
> objCDO.To = GetValue(email_rs, 0)
> objCDO.Subject = email_subject
> objCDO.Body = email_body
> objCDO.MailFormat = 0
> objCDO.Send
> set objCDO=Nothing
> email_rs.MoveNext
> wend
> end sub
>
> Then I have a page that allows an adminstrator to enter an email message,
> which gets recorded in the database, but in the "After Insert" Event I
call
> the above function with this code that sends emails to everyone:
> 'Send emails
> 'Select only those that match selected member status, or all if the status
> is = 0
> call sendemails("SELECT email FROM members WHERE email <> """"",
> fldemail_from, fldemail_subject, fldemail_body)
>
> My form contains fields: email_from, email_subject, email_body among
others.
>
> BTW, we plan to describe the above method in future CC documentation, as
it
> is an option for everyone to create CodeCharge components (by placing
> functions in the Modules section).
>
> Adam S.
> YS/CC
>
>
> "news-server" <you@me.com> wrote in message
>news:9ikr2e$dvl$1@news.codecharge.com...
> > Any tips on how I might use CodeCharge to send an e-mail to everyone in
a
> > database? Where do I put the code to send the e-mail?
> >
> > Rjb
> >
> >
>
>


   


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

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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