Bulk Email

  • Thread starter ekomsky via AccessMonster.com
  • Start date
E

ekomsky via AccessMonster.com

I'm using the code below to send to multiple recipients in a table. But it
only works for the first five recipients ? If i add more i only get hte
first one back ? does this have something to do with the length of the
string ? and how do i get around it, i have 40 recipients and i'm using Lotus
notes ?





Private Sub Command13_Click()
'Declaire Variables
Dim rs As New ADODB.Recordset
Dim strEmail As String

'Open ADO recordset change YourEmailTable to the name of the table or query
holding your emails

rs.Open "EmailListTable", CurrentProject.Connection, adOpenDynamic,
adLockOptimistic

'Clear strEmail Variable
strEmail = ""

'Start to loop through the recordset
Do While Not rs.EOF

'Build email string...change "emails" in "rs!emails" to the name of the field
in the table/query you specified earlier which holds the email address
strEmail = strEmail & rs!emails & ";"

'move to next record in recordset...go to beginning of loop and add the next
email of that record to the email string (strEmail)
rs.MoveNext
Loop

'Send email using SendObject...the "To" argument will be filled with the
values the constructed string "strEmail" holds
DoCmd.SendObject , , , strEmail, , , "test", "Test", True

'Close established references...clean up code
rs.Close
Set rs = Nothing
End Sub
 
E

ekomsky via AccessMonster.com

Is there a way to mass email in access if i have to use Lotus notes ?
 
T

Tony Toews [MVP]

ekomsky via AccessMonster.com said:
Is there a way to mass email in access if i have to use Lotus notes ?

There may be some answers at Microsoft Access Email FAQ - Lotus Notes
http://www.granite.ab.ca/access/email/lotusnotes.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
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

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

Top