CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge -> Programming

 Newsletter email

Print topic Send  topic

Author Message
RAN

Posts: 28
Posted: 04/04/2005, 1:59 AM

Hello you all,

I am using this code in my web server, but he only accept AspMail. Is possible made this code works on thath server? I think not....:-<

'Initialize impossible SQL
email_sql = "SELECT user_email,user_login FROM users WHERE 0=1"
'Make it possible
if fldnewsletter_1 = 1 then email_sql = email_sql & " OR newsletter_1=1"
if fldnewsletter_2 = 1 then email_sql = email_sql & " OR newsletter_2=1"

'Send emails
email_count = sendemailssql(email_sql, fldemail_from, fldemail_subject, fldemail_body, 1)

'Record Who and When sent the email
fldemail_date_sent = Now()
fldemail_sent_by = Session("UserID")

Thank you in advance.
View profile  Send private message
Nicole

Posts: 586
Posted: 04/04/2005, 4:24 AM

RAN,
Modify sendemail function located under Global Functions section to make it using ASPMail syntax. Sample code is available in ASPMail docs
http://www.serverobjects.com/comp/Aspmail3.htm
_________________
Regards,
Nicole
View profile  Send private message
RAN

Posts: 28
Posted: 04/04/2005, 6:04 AM

Dear Nicole,

Thank you for your great help but i have to send email only for some members "SELECT user_email,user_login FROM users WHERE 0=1"
Can you teach me how to do thath with AspMail?

Thank you in advance.
View profile  Send private message
RAN

Posts: 28
Posted: 04/04/2005, 6:08 AM

If I use this code

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "Joe’s Widgets Corp."
Mailer.FromAddress= "Joe@somehost.com"
Mailer.RemoteHost = "mailhost.localisp.net"
Mailer.AddRecipient "John Smith", "jsmith@anotherhostname.com"
Mailer.Subject = "Great SMTP Product!"
Mailer.BodyText = "Dear Stephen" & VbCrLf & "Your widgets order has been processed!"
if Mailer.SendMail then
Response.Write "Mail sent..."
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if


Can I put something like that?
Mailer.AddRecipient "SELECT user_email,user_login FROM users WHERE 0=1"

Thank you
View profile  Send private message
peterr


Posts: 5971
Posted: 04/04/2005, 9:46 AM

Nope. You would rather need to create a loop where you go through each record and execute the email function for each record.
You can find examples of such looping in the custom code section of many-to-many examples in CCS Example Pack.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


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

Web Database

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.