how to match specific count of email Ids in same mail recipient seperated by (,)comma?

Hi all,  I want to sent email to maximum 10 different mail ids at a time. If a user enters greater than 10 email ids then it should display massage like “you can send email to 10 recipients only.” And in the same case I also want to check whether the email id is not repeated, if it is then it should discard it or show the validation message for the same.   Can anyone help me to achieve this? Thanks in advance.
1 answers
  1. Take the string and find out how many commas there are in the string (with a replaceAll function, and then find the length of the string)
  2. If the number of commas > 9, show a validation message about only having 10 recipients
  3. Alternatively take the method mentioned below with the StringSplit java action and do a count, since you'll need that list anyway


For the duplicates:

  1. Make sure you do a toUpperCase or toLowerCase for your string so that any differences in typing the e-mail address don't matter for the duplication check
  2. Split the string into individual e-mail addresses, for instance by using the StringSplit java action from the community commons
  3. Use a plan like mentioned in this forum post on how to get a list of unique values