mailing list email

  • Thread starter andy stanford-jason
  • Start date
A

andy stanford-jason

hello, i have a database of people who i want to email. one of the fields
contains the email address for the person and another contains a tick box
indicating if they want the particular email. i was wondering how i would go
about sending an email to the selected ones? thanks for any help.

andy
 
A

Arvin Meyer [MVP]

Use a query to pick out the email addresses.

SELECT DISTINCT tblMember.Email
FROM tblMember
WHERE tblMember.Status=True;

Then either fill a text file that can be pasted in:

Function Foo()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strBCC As String
Dim i As Integer

Set db = CurrentDb
Set rst = db.OpenRecordset("Query1", dbOpenSnapshot)

With rst
If .RecordCount > 0 Then
.MoveLast
.MoveFirst
End If
End With

For i = 1 To rst.RecordCount
If Len(rst!Email) > 0 Then
strBCC = strBCC & rst!Email & ";"
End If
rst.MoveNext
Next i
strBCC = Left$(strBCC, Len(strBCC) - 1)

Open "C:\Projects\MailingList.txt" For Append As #1

Print #1, strBCC

Close #1

End Function

or if you use Outlook, use the code at:

http://www.datastrat.com/Code/MultipleEmail.txt
 
Top