I need to send an email to multiple recipients using the JMail component. The list varies based on numerous business rules, so it is more effective to dynamically build this list of recipients and store them in one variable.
If X Then
vTo = getemail(staffid1)&", "&getemail(staffid2)&", "&getmangeremail(staffid1)
Else
vTo = getemail(staffid1)&", "&getemail(staffid2)
End If
You get the idea...
With CDONTS I have achevied this by placing a comma delimited list of recipients in a string variable and then assigning it with:
cdontsobj.to = vTo
However on this assignment I am only permitted to use JMail. The closest syntax I could come up with for JMail is:
jmailobj.recipient (vTo)
However, this causes an error reaching the servers. If I hard code one email address the error goes away and the message is sent so I am sure this is the issue.
Any ideas how can I place my list of recipients in JMAIL?
Thanks!
If X Then
vTo = getemail(staffid1)&", "&getemail(staffid2)&", "&getmangeremail(staffid1)
Else
vTo = getemail(staffid1)&", "&getemail(staffid2)
End If
You get the idea...
With CDONTS I have achevied this by placing a comma delimited list of recipients in a string variable and then assigning it with:
cdontsobj.to = vTo
However on this assignment I am only permitted to use JMail. The closest syntax I could come up with for JMail is:
jmailobj.recipient (vTo)
However, this causes an error reaching the servers. If I hard code one email address the error goes away and the message is sent so I am sure this is the issue.
Any ideas how can I place my list of recipients in JMAIL?
Thanks!