Skip to main content
Participating Frequently
August 10, 2006
Question

ASPMailer - Create Mailing List

  • August 10, 2006
  • 1 reply
  • 485 views
I have a list of users with name and email address. I want to be able to use the following code (aspmail) to select the emails from a database in groups of 20 and have a period of 10 seconds in between groups of 20's. How can I modify the following code to do so. I have a lot of emails so I have to make sure that the script doesn't time out and finish sending the email to all my database.

I'm using asp/vbscript with access. Please advise.

<%
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%>
This topic has been closed for replies.

1 reply

Participating Frequently
August 13, 2006
I've approached the issue of a "timer" for various functions on different project, and my super-advanced programmer says there's no such function in ASP. I've looked and haven't found.

As for the issue of pulling 20 addresses at a time from the database, look up the following:

FOR loops

Here are a few tutorials I found:
http://www.freewebmasterhelp.com/tutorials/asp/4
http://www.w3schools.com/vbscript/vbscript_looping.asp

Of cours, you'll also have to repeat a 1-20 count, and start at the last read record, so it could be a little tricky.

I'm sure I haven't given you the full answer, but I hope this gets you started.