title: Dynamic mail id in mail service app of Google apps script
body: <p>I need to send a mail with a default message to the mail id specified by the user in the email field of an html form.I tried the below code which doesn't work.Is anything like URL queuing needed here. </p>
  
  <pre><code>&lt;form method="POST" action="https://script.google.com/macros/s/AKfycbwIzz6c_PL7D9ioCrzDRvTdmBj2nZR-2ekUZ9pjgHeG3b3Simg/exec"&gt;
      &lt;label for="mail"&gt;Enter your mailID:&lt;/label&gt;
      &lt;input type="email" id="mail" required&gt;
      &lt;input type="submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Google script API:</p>
  
  <pre><code> function doPost(e){
    var addr = JSON.stringify(e);
    MailApp.sendEmail(addr,
                     "Recovery email for TracerSC",
                     "Your one time password ");
  
  }
  </code></pre>
  
  <p>This is the error that I get</p>
  
  <blockquote>
    <p>Invalid email:
    {"parameter":{},"contextPath":"","contentLength":0,"queryString":"","parameters":{}}
    (line 5, file "Code", project "email")</p>
  </blockquote>
  
  <p>The below code which has the default mail id works fine for me</p>
  
  <pre><code>function doPost(){
  
    MailApp.sendEmail("example@abc.com",
                     "Recovery email for TracerSC",
                     "Your one time password ");
  
  }
  </code></pre>