Question How to send a single email message to all the email addresses in my query?

creolejazz

Registered User.
Local time
Today, 14:33
Joined
Jun 28, 2007
Messages
55
Hi. I have a simple need but all results of my search give me directions to do things far more complicated than I need. Maybe you can help me.

I have a query (Access 2007) that contains a field named "email" (which contains email addresses, of course). I want to email everyone in the query and they are all going to receive the same message. My email to them doesn't have to be personalized and I don't need to collect data from the recipients. I don't even need a reply to the email I send. What is the easiest way to accomplish this?

Any help appreciated. Thanks.

Dave
 
Queries are for getting data, filtering it, etc... You need to do this via a form.
I would use a select all and then send.
DoCmd.SendObject acSendNoObject, "FormTyp", acFormatHTML, [E Mail], , , , "Company Email", True, ""

HTH
 
I appreciate your reply. I am a novice though and just a little bit of step-by-step would be helpful. How do I " use a select all and send" and where do I enter that code? Thanks again.
 
Try this. Of course use your own names.
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE YourTableNameHere SET YourTableName.Yes/NoField = On"
DoCmd.SetWarnings True
Me.Requery

HTH
 
I can't imagine how that will lead to the goal. Dave, you'll need to loop a recordset of the query to get all the email addresses. Here's an example, though it's overly complicated:

http://www.granite.ab.ca/access/email/recordsetloop.htm

The method will change slightly depending on whether you wasn't to send a single email or one each.
 
Since you can't email people from a query, it was my understanding that the goal was to select all email addresses, via a form of course and what I posted would do so. If that's not the case then I guess I did not understand.

Here is screenshot of what I believe is the end result.
 
Last edited:
I think the goal is to send an email to all addresses in the query, but Dave can clarify.
 
Thank you all for the help. But I ended up just taking the path of least resistance. I found the intended recipients by creating a query. I right-clicked the "email" column/field and COPIED the email addresses. I then just pasted them into the BCC field of a new Outlook email and clicked SEND. LOL I know it's a simplistic approach but it worked and that's all I needed to do.

Be advised, this actually may not work for everyone. I had over 1,000 recipients and some email servers don't allow you to email that many recipients at the same time. Mine, however, has no such restraints so it worked fine.

Thanks again for the feedback.

Dave
 
A word of warning.
Sometimes it is not your system deciding this but rather some server between you and the receivers.
Some are set to automatically flag the sender as a spammer and within a day you could end up being banned completely as they exchange this kind of information.
Based on experience it can take more than a week to be removed from the spammer list and it just takes a single mistake to end up on it again
 
I can't imagine how that will lead to the goal. Dave, you'll need to loop a recordset of the query to get all the email addresses. Here's an example, though it's overly complicated:

http://www.granite.ab.ca/access/email/recordsetloop.htm

The method will change slightly depending on whether you wasn't to send a single email or one each.

I tried this above link with docmd.sendobject method. It fetches only the last email id in from the recordset. Please let me know where I am missing.

Thank you

Private Sub CmdEmail_Click()
On Local Error GoTo Some_Err

Dim MyDB As Database, RS As Recordset
Dim strBody As String, lngCount As Long, lngRSCount As Long

DoCmd.RunCommand acCmdSaveRecord
Set MyDB = DBEngine.Workspaces(0).Databases(0)

Me!txtProgress = Null
Set RS = MyDB.OpenRecordset _
("Select cEmailaddress from Emails")
lngRSCount = RS.RecordCount
If lngRSCount = 0 Then
MsgBox "No promo email messages to send.", vbInformation
Else
RS.MoveLast
RS.MoveFirst
Do Until RS.EOF
lngCount = lngCount + 1
lblstatus.Caption = "Writing Message " & CStr(lngCount) _
& " of " & CStr(lngRSCount) & "..."
strto = RS!cEmailAddress
intMessageID = Year(Now) & Month(Now) & Day(Now) & Fix(Timer) & "_MabryMail"
' Send the email using some technique or other
RS.Edit
'RS("cpeDateTimeEmailed") = Now()
RS.Update

RS.MoveNext

Loop

DoCmd.SendObject acSendNoObject, , , strto, , , "Test", "Trial"

End If
RS.Close
MyDB.Close
Set RS = Nothing
Set MyDB = Nothing
Close

Me!txtProgress = "Sent " & CStr(lngRSCount) & " emails."
lblstatus.Caption = "Email disconnected"
MsgBox "Done sending Promo email. ", vbInformation, "Done"
lblstatus.Caption = "Idle..."
Exit Sub

Some_Err:

MsgBox "Error (" & CStr(Err.Number) & ") " & Err.Description, _
vbExclamation, "Error!"
lblstatus.Caption = "Email disconnected"
End Sub
 
Try

strto = strto & RS!cEmailAddress & ";"
 

Users who are viewing this thread

Back
Top Bottom