Send Email Based On a Query

  • Thread starter Thread starter TimWal
  • Start date Start date
T

TimWal

Hey guys,

I have been looking for an issue that I have.

I have a database with a number of customer email addresses in them
and I want to send an email to a number of them based on a query
(essentially to limit who gets the email), what I need to know is how
to do this.

Any help would be greatly appreciated.
 
TimWal said:
Hey guys,

I have been looking for an issue that I have.

I have a database with a number of customer email addresses in them
and I want to send an email to a number of them based on a query
(essentially to limit who gets the email), what I need to know is how
to do this.

Any help would be greatly appreciated.

Sounds like you need to open a recordset based on your query, and then
loop through the records and send a message to each (use SendObject,
or automate Outlook, or use CDOSys available at the MS site). Search
the NG. There are examples all over the place. There's a nice one at
Danny Lesandrini's site. www.amazecreations.com then look for the
database stuff.
 
TimWal said:
I have a database with a number of customer email addresses in them
and I want to send an email to a number of them based on a query
(essentially to limit who gets the email), what I need to know is how
to do this.

You will need to use VBA code to run through a recordset either:
1) concatenating the email addresses to a string along with a comma,
sem-colon or other appropriate separator character, such as comma or
semi-colon, and then send one email with
all the bcc addresses;
2) individually send the emails.

Your method of sending emails may have some restrictions as to the
number of email addresses in the bcc field or the length of data in
that field.

For sample recordset logic see
http://www.granite.ab.ca/access/email/recordsetloop.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top