Group Email

CommanderK

New Member
Joined
Oct 18, 2005
Messages
27
I run a query that returns a list of customers - I have all their emails stored as well

I want to send an email report to all the results in the query.

Any idea on how to do this ?

Thanks !
:huh:
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
You'll need to write code that loops through the records returned by the query.

You could either use it to construct the list of emails to send the report to, then send the email or to send individual emails.
 
Upvote 0
The way I'm thinking is to use DAO, so go to the VB editor, and add the Microsoft DAO 3.6 reference.

Then here's the code I'm thinking:
Code:
Sub emailer()

    Dim db As DAO.Database
    Dim rs As DAO.Recordset
    
    selSQL = "SELECT qryTest.* FROM qryTest;"
    
    Set db = CurrentDb()
    Set rs = db.OpenRecordset(selSQL)
    
    Do Until rs.EOF
        DoCmd.SendObject acSendReport, "rptTest", acFormatSNP, rs!email, , , _
                                       "Your Message Here", _
                                       "Your email body here", False
        rs.MoveNext
    Loop

'some other output format constants
'acFormatRTF
'acFormatHTML
'acFormatXLS
'acFormatSNP
'acFormatRTF
'acFormatTXT

End Sub

Keep in mind your global Wndows email settings will affect the actual manner in which these email requests are handled on your PC.

Also, you will be prompted for each emailing as a security measure, check out "Outlook Redemption" to workaround this security measure. The security measure is there to prevent your PC from sending emails without your knowledge.

An example is posted here:
http://www.newfloent.com/db_examps/emailer.mdb
 
Upvote 0

Forum statistics

Threads
1,224,800
Messages
6,181,045
Members
453,014
Latest member
Chris258

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top