E-Mail Loop Alternatives

  • Thread starter Thread starter jtish
  • Start date Start date
J

jtish

Guest
I am trying to help a friend's business with a customer contact database -

Is there a way to populate e-mail recipients based on query values (assume a list of 50 addresses) in the bcc: field? I can do them one-by-one using Talismanic's loop e-mail code, but I want to do it all at once.

Also, can you use the SendObject argument to have Access send a form (datasheet view) or report in the e-mail body rather than as an attachment in one of the supported formats?

Thanks.

Tish
 
Admins...

We need a new forum called "Code Bank"
in there code should be posted to do a specific thing, as an attachment preferablly. These are questions that are asked over and over, the logical thing to do is archive these things so we can reference them, otherwise the administration that is going on right now is lacking.

As for your question you need to loop and append to a string...then get rid of the ';' at the end of the string and then shoot the email...

for instance:

Code:
dim db as database
dim rs as recordset
dim s as string

set db=currentdb

set rs=db.Openrecordset("YourQueryOrTable")

while not rs.eof
  s = s & rs("name").Value & ";"
  rs.movenext
wend

'get rid of last ;
s= Left(s, Len(s)-1);

'add using the reciepient property
emailsend.recipients.add(s) 'it may be something else here...but you  get the idea

emailsend.send
 
try this

go to this thread. sounds like you are needing to do exacly what I needed to do. I took all the email sending info i learned from this forum and put it into one 3 form database showing 3 examples of populating email. one uses a loop to query your table and then puts them all in the bcc field

http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=59311

hope this helps
 

Users who are viewing this thread

Back
Top Bottom