Hi,
can someone help me figure out how to mask the To: field of the recipients i send a bulk email to?
here is my code (by the way using outlook express)
can someone help me figure out how to mask the To: field of the recipients i send a bulk email to?
here is my code (by the way using outlook express)
Code:
Function SendMail()
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim strSQL As String
Dim strEmail As String
Dim strbody As String
Dim strESubject As String
Dim fso As Object
Dim f As Object
Dim ts As Object
' Return reference to current database.
Set dbs = CurrentDb
'Find record to send report of
strSQL = "SELECT EmailName " & _
"FROM email2infopromisedtbl"
Set rst = dbs.OpenRecordset(strSQL)
If rst.BOF And rst.EOF Then
rst.Close
Set rst = Nothing
Set dbs = Nothing
Exit Function
End If
strEmailname = ""
Do While Not rst.EOF
strEmailname = strEmailname & rst("Emailname") & ";"
rst.MoveNext
Loop
strEmail = Left(strEmailname, Len(strEmailname) - 1)
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile("\\ls-server\leads\scripts_etc\emailIP.txt")
Set ts = f.OpenAsTextStream(1, -2) 'ForReading, TristateUseDefault
strbody = ts.ReadAll
ts.Close
Set ts = Nothing
Set f = Nothing
Set fso = Nothing
strESubject = "Reminder from LSI"
' send email.
DoCmd.SendObject acSendNoObject, "", acFormatTXT, strEmail, , , strESubject, strbody, False
rst.Close
Set rst = Nothing
Set dbs = Nothing
End Function