[AccessD] Sending multiple e-mails

Stephen Bond stephen at bondsoftware.co.nz
Fri Feb 27 22:13:39 CST 2004


I am sending one e-mail to each person on file.  Each e-mail has that person's individual details.  Here is the code snippet ...
=======
  If Not rs.BOF And Not rs.EOF Then
    rs.MoveFirst
    Do Until rs.EOF
      GoSub BuildBodyOfEmail     ' build field 'eMailBody'
      MsgBox "email for " & rs!pId & " " & rs!pSurname
      DoCmd.SendObject acSendNoObject, , , _
                       "mytest at mydomain.co.nz", _
                       , , "Subject Test", _
                       eMailBody, True
      rs.MoveNext
      DoEvents
    Loop
  End If
========

The problem is the first record in the recordset pops up as a new mail message OK, but subsequent records don't.  The debugging MsgBox comes up for each record so I know the loop is getting the right records.  Changing the SendObject's 'editmessage' flag from True to False doesn't make any difference.

Eventually I want to change the SendObject's 'editmessage' flag from True to False so the e-mails   go straight out without visual verification.  The False is for testing purposes meantime.

Weird.  Any thoughts .....

Stephen Bond 



More information about the AccessD mailing list