var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: email to a group in access
i have a contact database that will have name, company, email, event and group field. The group is a dropdown box. Each name belongs to a specific group. I would like to have letter (report) to send the email that has letter attached to the group. Can you give me an idea? Also we like the sender is always the same address no matter who use the database. Is it possible? Many thanks.
I don't know about how to force the "from" name, but here is how you can create the email. I modified this from a program I wrote, so you may need to add a little error checking.
Public Function SendEmail()
On Error GoTo SendEmail_Error
Dim rst As Object
Dim strTo As String
Dim strSubject As String
Dim strBody As String
Dim lngCount As Long
Dim strGroupFromDropdown as string
strSQL = "SELECT [RecipientEmail] from qryEmail WHERE Group= ‘"
strSQL = strSQL & strGroupFromDropdown & “’”
Set rst = CurrentDb.OpenRecordset(strSQL)
lngCount = rst.RecordCount
For x = 1 to lngCount
strTo = strTo & rst(“RecipientEmail”) & ";"
strSubject = “Put text here, can construct from database fields”
strBody = “Put text here, can construct from database fields”
If Not IsNull(strTo) Then
DoCmd.SendObject , , , strTo, , , strSubject, strBody, 0
MsgBox "There is no name available for sending the message.", vbInformation, "Unable to send email"
MsgBox "There was an error."
Thank you very much! I will try.