title: Sending emails to multiple recipients
body: <p>I am trying to send emails to N number of people. I have passed the email id of gmail to a value called toAddresses, since I need to separate those string elements with comma (,) </p>
  
  <p>I used this technique  </p>
  
  <pre><code>String[] contactList=request.getParameterValues("mail_contacts");
  
  InternetAddress[] toAddress = new InternetAddress[contactList.length]; 
  for (int i = 0; i &lt; contactList.length; i++) {
      toAddress[i] = new InternetAddress(contactList[i]+",");
      out.println("&lt;p&gt;"+toAddress[i]+"&lt;/p&gt;&lt;p&gt;"+toAddress[i].toString()+"&lt;/p&gt;");
  }
  msg.setRecipients(Message.RecipientType.TO, toAddress);
  </code></pre>
  
  <p>But I am getting an error from the console which says 
  "Missing required header 'To'"</p>
  
  <p>Kindly help me resolve this error</p>