Hi,
I use the code below to send e-mails, but i would like to make some changes to it.
First problem is that i send e-mails to different people, let's say 10 persons, but i need to click on the "Send"-button in Outlook for every e-mail (so 10 times).
What do i have to change in this code to send them in one time?
Second thing i would like to change is to use the BCC-field instead of the To-field because now everybody can see the other recipients...
But i'm not familiar with VBA, i'm affraid, so a little help would be great!!!
Private Sub CmdEmail_Click()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("QrySendEmails")
Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("Email").Value
DoCmd.SendObject , , , strEmail, , , _
"Subject", _
"Good Afternoon" & _
vbCrLf & vbCrLf & "Your Message.", True
rsEmail.MoveNext
Loop
Set rsEmail = Nothing
MsgBox "Emails have been sent"
End Sub
Thanks already guys!
I use the code below to send e-mails, but i would like to make some changes to it.
First problem is that i send e-mails to different people, let's say 10 persons, but i need to click on the "Send"-button in Outlook for every e-mail (so 10 times).
What do i have to change in this code to send them in one time?
Second thing i would like to change is to use the BCC-field instead of the To-field because now everybody can see the other recipients...
But i'm not familiar with VBA, i'm affraid, so a little help would be great!!!
Private Sub CmdEmail_Click()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("QrySendEmails")
Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("Email").Value
DoCmd.SendObject , , , strEmail, , , _
"Subject", _
"Good Afternoon" & _
vbCrLf & vbCrLf & "Your Message.", True
rsEmail.MoveNext
Loop
Set rsEmail = Nothing
MsgBox "Emails have been sent"
End Sub
Thanks already guys!