Skip to main content
October 18, 2011
Answered

pull emails off database

  • October 18, 2011
  • 1 reply
  • 1713 views

DW CS3 - ASP VBScript - Access

How do I do this?  I'd like to pull emails from all records in a table where a specific column is checked Yes (subscribed), in order to send group email.

Are there scripts to handle this?

This topic has been closed for replies.
Correct answer bregent

Then you just need to search the web for something like 'asp mail list script'.  The basic concept is simple. Load the addresses into a recordset, and loop through the recordset adding addresses to the email bcc field.  Because mail servers have max address limitations, it also needs to have another loop to break the records into smaller sets of 25-50 addresses.

1 reply

Participating Frequently
October 18, 2011

There are scripts out there, but it's a pretty simple loop you can write yourself. Much of how you do it depends on how large a group you are mailing. What is the size of the list?

October 18, 2011

Nothing over 300 recipients, but that number will change. Unfortunately, I have email limitations and may eventually resort to an email marketing system.  For now, I'd like to try a simple ready-made script if available, with instructions.

November 3, 2011

First start by seeing if you can manually send an html email via scripting using this straightforward tutorial.

http://chrishardy.co.uk/asp/tutorials/email-cdosys.asp

>So if I've got an html newsletter saved as 'newsletter.htm'

OK, if you want to store the newsletter content in a separate file from the script that's fine. You will need to use some ASP filesystem functions to read it into a variable that you can place in the email. But don't worry about that for now - just put the html into the newsletter.asp script.

>Is there a submit button or something?

The newsletter.asp script will run, and send the emails, everytime it is loaded into a browser, so make sure it has security to prevent a random web visitor from accessing it. What I have done before is create a form page  that has some options to select and a submit. The form is submitted to the newsletter.asp, and the options selected could be used to maybe filter the sql recordset, select a specific version of the newsletter, etc.

>Can this be done if the email addresses are pulled from a

>database residing on my web host's server, yet

>emailed through my ISP's mail server?

Possibly. Read here for sending via remote email server.

http://www.developerbarn.com/asp-code-samples/19-sending-email-using-cdosys-classic-asp.html

Have you also thought of using an email marketing service?: http://email-marketing-service-review.toptenreviews.com/

Takes a lot of the headaches out of the process. They have easy ways to import/sync your current contact lists.


Thank you, I will study the tutorial - I'm pretty sure I've come across that tutorial a few times in my research. 

Okay, so normally the script is stored with the newsletter itself in an .asp file. That makes sense. Obviously, one must be absolute certain the newsletter is completely ready to go before uploading it since the script will run, which concerns me as much as I test my newsletters and make changes before emailing. Of course, certain code (maito:) could be modified or temporarily eliminated accordingly for testing purposes, I suppose.

I actually joined an email marketing service and started setting up. What irks me (at least with this particular service) is that users can only sign up for subscription items on my site (I offer about seven), but not view or manage those items from my site; they have to link from the newsletter to do that.  It would be nice if I could use the email service as well as keep an active user/subscriber database and pull that information into my user's account.

I love the link you sent on comparing email marketing services... thanks!