multiple e-mail addresses through Access (2 Viewers)

B

buster

Guest
Does anyone know the syntax to use to add more than one email address to the SendObject command? I have people addresses all with their e-mail address and I would like to do one mass e-mail to them all from Access. Any suggestions?
 

Travis

Registered User.
Local time
Yesterday, 16:56
Joined
Dec 17, 1999
Messages
1,332
What I would do is take your list of Email addresses and append them to a single string.

Such as:

Dim rst as Recordset
Dim stSQL as String
Dim stTO as String

stSQL = "Select EMail from Clients"
set rst = Currentdb.OpenRecordset(stSQL)
With rst
.movefirst
do while not .EOF
stTO = stTO & iif(stTO<>"",";","") & .Fields("Email")
.MoveNext
Loop
End With

This example loops through the Client Database and appends the Email addresses together adding a ";" between each address. A "," will also work.

Now you can use:
DoCmd.SendObject acSendNoObject, , , stTO, , , "Test", "Hi this is a test", True

Another method is to create an Email Group and use that vice that list of names. The only problem with using a group is that you will have to maintain it manually and Other people may not have this group on their machines (problem only if you distribute your db to others or someone else needs to be able to run this.) This is why I suggest the method above.
 

Users who are viewing this thread

Top Bottom