Greetings:
I am trying to send out a personalized email to any given number of people. While the loop is working, only the first person on the list gets an actual email. Is some flag in the SendObject turning off?
Here is my code:
Set rst = Me.RecordsetClone
rst.MoveFirst
Do Until rst.EOF
varSalutation = rst!Salutation
varNameLast = rst!NameLast
varIntro = Me.Intro
varBody = Me.Body
varClosing = Me.Closing
varSignature = Me.Signature
varEmail = rst!Email
EmailInfo = "Dear " & varSalutation & " " & varNameLast & ":" & vbCrLf
EmailInfo = EmailInfo & vbCrLf
EmailInfo = EmailInfo & varIntro & vbCrLf
EmailInfo = EmailInfo & vbCrLf
EmailInfo = EmailInfo & varBody & vbCrLf
EmailInfo = EmailInfo & vbCrLf
EmailInfo = EmailInfo & varClosing & vbCrLf
EmailInfo = EmailInfo & vbCrLf
EmailInfo = EmailInfo & "Sincerely," & vbCrLf
EmailInfo = EmailInfo & varSignature & vbCrLf
DoCmd.SendObject acSendNoObject, " ", acFormatRTF, rst!Email, , , "Update Information", EmailInfo, False
rst.MoveNext
Loop
rst.Close
str1 = "Number of emails sent = " & rst.RecordCount
MsgBox str1, vbInformation, "Email Successful"
HELP!!!!!
Thanks...Basia
I am trying to send out a personalized email to any given number of people. While the loop is working, only the first person on the list gets an actual email. Is some flag in the SendObject turning off?
Here is my code:
Set rst = Me.RecordsetClone
rst.MoveFirst
Do Until rst.EOF
varSalutation = rst!Salutation
varNameLast = rst!NameLast
varIntro = Me.Intro
varBody = Me.Body
varClosing = Me.Closing
varSignature = Me.Signature
varEmail = rst!Email
EmailInfo = "Dear " & varSalutation & " " & varNameLast & ":" & vbCrLf
EmailInfo = EmailInfo & vbCrLf
EmailInfo = EmailInfo & varIntro & vbCrLf
EmailInfo = EmailInfo & vbCrLf
EmailInfo = EmailInfo & varBody & vbCrLf
EmailInfo = EmailInfo & vbCrLf
EmailInfo = EmailInfo & varClosing & vbCrLf
EmailInfo = EmailInfo & vbCrLf
EmailInfo = EmailInfo & "Sincerely," & vbCrLf
EmailInfo = EmailInfo & varSignature & vbCrLf
DoCmd.SendObject acSendNoObject, " ", acFormatRTF, rst!Email, , , "Update Information", EmailInfo, False
rst.MoveNext
Loop
rst.Close
str1 = "Number of emails sent = " & rst.RecordCount
MsgBox str1, vbInformation, "Email Successful"
HELP!!!!!
Thanks...Basia