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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Emails

Status
Not open for further replies.

jocat

Technical User
Dec 28, 2001
25
US
I have a database that contains a table of individuals. I would like to send Email messages to all, or select individuals within the table.

Can anyone advise me on the best method to perform this task.

Your help would be greatly appreciated.
 
Jo,

The following will create a new email message assuming you're using MS Outlook as your mail client.


Dim olApp As Object
Dim subject As String
Dim olMailItem
Dim newMail
Dim newRecipient
Dim mailBody As String

subject = "Your text here"
mailBody = "Your text here"

Set olApp = CreateObject("Outlook.Application")
Set newMail = olApp.CreateItem(olMailItem)
Set newRecipient = newMail.Recipients.Add(someone@somewhere.com)

With newMail
.subject = subject
.body = mailBody
End With

newMail.send

olApp.Quit
Set olApp = Nothing
Set newMail = Nothing
Set newRecipient = Nothing

hope this helps.


Leigh Moore
LJM Analysis Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top