I posted earlier today but realize I should be taking a different approach to my problem. Goal: send a DIFFERENT e-mail to a set of clients obtained by query. The code below works great if the e-mail to each person is the same. I hope to achieve a customized e-mail to each recipient detailing their order shipment. The code calls the query and inserts the e-mails found but all in one message. Any assistance is appreciated.
Public Function sendEmail()
Dim rs As New ADODB.Recordset
Dim strEmail As String
rs.Open "qrydailyordermailmerge", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
strEmail = ""
Do While Not rs.EOF
strEmail = strEmail & rs!ContactEmail & ";"
rs.MoveNext
Loop
DoCmd.SendObject , , , strEmail, , , "Your Order Confirmation from MY COMPANY NAME HERE", "Test", True
rs.Close
Set rs = Nothing
End Function
Thanks.
Heather
Public Function sendEmail()
Dim rs As New ADODB.Recordset
Dim strEmail As String
rs.Open "qrydailyordermailmerge", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
strEmail = ""
Do While Not rs.EOF
strEmail = strEmail & rs!ContactEmail & ";"
rs.MoveNext
Loop
DoCmd.SendObject , , , strEmail, , , "Your Order Confirmation from MY COMPANY NAME HERE", "Test", True
rs.Close
Set rs = Nothing
End Function
Thanks.
Heather