recipients.add ?

jetson

Registered User.
Local time
Today, 00:09
Joined
Jan 10, 2003
Messages
18
Basically, recipients.add works fine with 1 email account (name@domain.com). As soon as I add another name to the string, separated by either a comma or a semi-colon, I get an undeliverable message. (name1@domain.com; name2@domain.com). Here's my code: (note - the function uses strecipient, but before I put a string in that variable with multiple email addresses, I'm hardcoding using "name1@domain.com" for testing purposes)

Function sendmail(strecipient As String, strisscat As String, strisstext As String)
Dim olApp As Object
Dim olNameSpace As Object
Dim olMail As Object

Set olApp = CreateObject("outlook.application")
Set olMail = olApp.CreateItem(0)
With olMail
.Subject = "Mew MDM Issue"
.Recipients.Add strecipient
.Body = "An issue has been entered into the MDM issues database: " + Chr(13) + _
" " + Chr(13) + _
"Issue Category: " + strisscat + Chr(13) + _
"Issue Text: " + strisstext
.Send
End With
End Function
 
From: Expand Your Outlook with Access 97
David M. Shank


...To include multiple recipients, execute the Recipients collection Add method for each person you want included...


You can still pass the Deliminated string and use the Split Function to make it a single dimentioned array. Loop the array and add each person.
 
I should be using the .To = strecipients instead of recipients.add.

my bad
 

Users who are viewing this thread

Back
Top Bottom