Below are small snippets of code that I’m trying to make work. My email formats correctly and my array is populated correctly. But the SetHeaderVal method looks like it can only accept a string. I want to use an array of email addresses I’m gathering from documents in the database. So, does anyone know how to make this work with a variable for that method’s parameters?
’ Setup EMail MIME Body
Set body = EMailDoc.CreateMIMEEntity
’ Gather email addresses from db documents into an array
Do Until (doc Is Nothing)
Activated = doc.Activated(0)
If Activated = "Activated" Then
Set emailaddress = doc.getfirstitem("emailaddress")
Call item.AppendToTextList( emailaddress)
End If
Set doc = view.GetNextDocument(doc)
Loop
’ Set email addresses in the BCC field
Set header = body.CreateHeader(“BCC”)
Call header.setHeaderVal(item)
I’m getting a type mismatch on the last line here. Every example I’ve seen uses a hard coded, single person for parameters - Call header.setHeaderVal(“Jerry Hadley”)
This works well, but I need to send to multiple email addresses in an Array.
Please help a MIME rookie!