Hide Receipent Name (1 Viewer)

Ricky

Registered User.
Local time
Today, 19:01
Joined
May 30, 2000
Messages
13
I would like to send a mass email based on email address from my Access database. This email would go out to many different customers. My problem is I do not want the customers to be able to see who else this email was sent too. Is there anyway to accomplish this using vb? Thanks.
 

Atomic Shrimp

Humanoid lifeform
Local time
Today, 19:01
Joined
Jun 16, 2000
Messages
1,954
We're not talking about spamming here, are we?, I'm sure that everybody on your list is there because they want to be? OK?, good!, here's how I would do it:

if your email addresses are in a field in a table, you just query them into a recordset and step through the records one by one, using SendObject for each step, something like this:

Dim db As Database
Dim RstTmp As Recordset
Dim Loop1 As Long
Dim SqlStr As String

Set db = CurrentDb()

SqlStr = "SELECT people.[E Mail] FROM people GROUP BY people.[E Mail];"

'get it into a recordset
Set RstTmp = db.OpenRecordset(SqlStr, dbOpenSnapshot)
DoEvents
'get an accurate recordcount(
On Error Resume Next
RstTmp.MoveLast
RstTmp.MoveFirst
On Error GoTo 0
')

'if nothing to do
If RstTmp.RecordCount = 0 Then
MsgBox "there is nobody in the list"
Exit Sub
End If

For Loop1 = 1 To RstTmp.RecordCount
'send the mail
DoCmd.SendObject acSendReport, "reportname", acFormatHTML, RstTmp.Fields![E Mail].Value, , , "Please read this", , False
RstTmp.MoveNext
Next Loop1

MsgBox (Loop1 - 1) & " Messages sent"

I've got a demo of a refinement of this which will customise the email contents for the individual recipient; if you'd like to see it, email me, I'll send it to you by reply.


Mike
 

Atomic Shrimp

Humanoid lifeform
Local time
Today, 19:01
Joined
Jun 16, 2000
Messages
1,954
Oops, don't forget:

db.Close
 

Ricky

Registered User.
Local time
Today, 19:01
Joined
May 30, 2000
Messages
13
No spamming here, the list contains only customers for the company I work for. Thanks for the help
 

Users who are viewing this thread

Top Bottom