I have a text field that allows users (on the web) to enter a single address or group name. When the button is pushed, the sendmail agent grabs the address and sends a custom email based on document data. This part works 100%… but am having a problem with multiple email addresses. I tried entering address1, address2, address3 (separated with comma like in Notes mail). I see the server console try and send to the addresses… probably treating it as 1 large address. Any ideas? Is this possible with a text field? Maybe the multiple values option with comma separator must be checked. Will test… thanks team.
Subject: Text field and multiple emails + send mail agent
If you want to send a mail to multiple recipients, the recipient field (SendTo) must be a multi-value field.If your input form only supports single-value, tell your users to separate the entries with comma.
In your agent, split the value.
Dim vSplit As Variant
vSplit = Split(doc.Recipient(0), “,”)
Call docMail.ReplaceItemValue(“SendTo”, vSplit)
That should do it.
// Ken, www.noteshound.com
Subject: RE: Text field and multiple emails + send mail agent
Thanks! At the moment, it is just a plain text field. I’ll try the split option… sounds perfect. Have a great day.
I’m assuming that recipient should be sendto, right? I updated below:
Dim vSplit As Variant
vSplit = Split(doc.SendTo(0), “,”)
Call docMail.ReplaceItemValue(“SendTo”, vSplit)