title: Google App Script: Create a list manually
body: <p>I am trying to create a list of email recipients instead of just one recipient. Then send the email to all these recipients through app inventor. How do I do it? The code below send to only one recipient</p>
  
  <pre><code>function contactUsMailer(e) {
  try {
  var recipient = "example@gmail.com "
  var timestamp = e.values[0];
  var name = e.values[1];
  var email = e.values[2];
  var message = e.values[3];
  var body = name+' &lt;'+email+'&gt; sent the following message: '+message;
  var bodyHTML1 = '&lt;p&gt;'+name+' &lt;a href="mailto:'+email+'"&gt;'+email+'&lt;/a&gt; sent the following message: &lt;/p&gt;';
  var bodyHTML2 = '&lt;blockquote&gt;'+message+'&lt;/blockquote&gt;';
  var bodyHTML3 = '&lt;p&gt;Sent by the Pura Vida Apps &lt;a href="http://www.puravidaapps.com/sendmailGS.php"&gt;Send Mail example&lt;/a&gt;.&lt;/p&gt;';
  var advancedArgs = {htmlBody:bodyHTML1+bodyHTML2+bodyHTML3 , replyTo:email};
  MailApp.sendEmail(recipient, "Contact Us Form", body, advancedArgs);
  } 
  catch(e){
  MailApp.sendEmail(recipient, "Error - Contact Us Form", e.message);
    }
  }  
  </code></pre>