title: Grail mail plugin - unable to add in multiple TO addresses?
body: <p>New to grails world.  I am having issues passing the comma seperated form values from a form into the 'TO' properties of the grails mail plugin. no matter what I try I can seem to get it to an array or accept multiple email addresses.</p>
  
  <p>Im getting the following error; I have removed the domain names so please disregard them.</p>
  
  <pre><code>Could not parse mail; nested exception is javax.mail.internet.AddressException:
  Illegal address in string ``"ian@email.com","ian@otheremail.com"''
  </code></pre>
  
  <p>Scratching head now, any ideas of where I am going wrong with the below code. I'm completely stumped.!!</p>
  
  <p>in emailpublication GSP form I have. these fields are automatically populated from the database and id of document.</p>
  
  <pre><code>&lt;g:form action="emailpublication"&gt;
  
  &lt;g:field type="text" name="whogetsemail" value="${publicationInstance?.portfolio?.emailtemplates?.toemailtemplate}" /&gt; 
  &lt;g:field type="text" name="publicationName" value="${publicationInstance?.publicationName}" /&gt;
  &lt;g:textArea type="text" name="publicationContent" value="${publicationInstance?.publicationContent}" cols="20" rows="20"/&gt; 
  &lt;g:hiddenField name="id" value="${publicationInstance?.id}" /&gt;
  
  &lt;input type="submit" value="Send Email"/&gt;
  &lt;/g:form&gt;
  </code></pre>
  
  <p>In Publication controller I have the following; I need to send TO on one or more email address populated from the whogetsemail field in the emailpublication gsp form</p>
  
  <pre><code>def emailpublication(){
  
    List&lt;String&gt; recipients = request.getParameterValues("whogetsemail")
      try {
       sendMail{
               to  (recipients.toArray())
               from "ineilsen@emailaddress.com"
               subject params.publicationName
               text params.emailbodyheader + "\n"+"\n" + params.publicationContent + "\n"+"\n" + params.footeremailtemplate
           }
  
      }
      catch (MailException e) {
          log.error "Failed to send emails: $e.message", e
      }
      catch (MessagingException e) {
          log.error "Failed to send emails: $e.message", e
      }
      redirect(uri: "/publication/show/${params}")
              flash.message = "${params.publicationName} sent to ${params.emailto}"
  }
  </code></pre>
  
  <p>Thanks all, look forward to replies, Im frustrated with </p>