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.
|
|
|
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 |
|
|
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.
|
|
|
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
|
|
|
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 |
|
|
|