RvH Posted January 19, 2010 Posted January 19, 2010 I have not been succesful in sending mails to multiple recipients using a field containing a comma separated list. I tried modifying the script by adding .parse(to, true) to InternetAddress in msg.setRecipient, but to no avail. Any help/hints would be much appreciated.
Savery Posted January 19, 2010 Posted January 19, 2010 Have you considered placing a send-single command within a loop which get the next email address from a list held in a variable?
RvH Posted January 20, 2010 Author Posted January 20, 2010 Yes, I did. This is actually my present work-around, but it does mean that a recipient cannot rapidly tell from the email distribution whether others have been addressed too. (In my work-around this information therefore is added to the email subject line, but it looks a bit messy.) I just thought that Scriptmaster was advertised as providing support for multiple recipients (which I presumed to be using a comma separated list), but unfortunately I cannot get it going with the standard Scriptmaster calls.
andries Posted January 21, 2010 Posted January 21, 2010 you have to pass an array of InternetAddresses, not a comma separated list. InternetAddress[] myList=//create the list.... message.addRecipients(Message.RecipientType.TO,myList);
RvH Posted February 3, 2010 Author Posted February 3, 2010 That was a good hint. Much obliged. As I am using a FM field with a list as the addressees, the coding needed to be a bit more elaborate: String mailAddressTo=(to); String[] ToAddresses = mailAddressTo.split("n") ; InternetAddress[] mailAddress_TO = new InternetAddress [ToAddresses.length] ; for (int j=0; j mailAddress_TO[j] = new InternetAddress(ToAddresses[j]); } msg.addRecipients(Message.RecipientType.TO, mailAddress_TO);
Recommended Posts
This topic is 5418 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now