Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do send email using addresses in access table 1

Status
Not open for further replies.

noleson

Programmer
Dec 16, 2003
5
US
I need to send a single document, a Notice of Race, to 290 sailors whose names are in an Access table. Would really appreciate some direction on how to do this.

I am not a spammer.

Thanks
Norm Oleson
 
I'm assuming you know how to query your table for the names. Once you do that all you need to do is loop through each name in the table and execute your Sendmail procedure. Here's the Sendmail procedure I use. It doesn't rely on the clients E-Mail client and just send via SMTP. The only requirement obviously is that you have a SMTP server available to you.

Public Function SendMail(sFrom As String, sTo As String, sSubject As String, sMessage As String)

Set objEmail = CreateObject("CDO.Message")

objEmail.From = sFrom
objEmail.To = sTo '//// format "abc@emailadd.com; edf@emailadd.com"
objEmail.BCC = ""
objEmail.Subject = sSubject
objEmail.TextBody = sMessage
'objEmail.AddAttachment strAttach
objEmail.Configuration.Fields.Item(" = 2
objEmail.Configuration.Fields.Item(" = "YourSMTPServerNameOrAddress"
objEmail.Configuration.Fields.Item(" = 25
objEmail.Configuration.Fields.Update
objEmail.Send
Set objEmail = Nothing

End Function

Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top