title: Error in Google Apps Script when HTML form input field is empty
body: <p>My <code>Google Apps Script</code> receives data from an <code>HTML</code> <code>form</code>, then sends an email confirmation to a customer. It gets the email address from <code>input type=email</code>, and if this input field is left blank, the script produces an error.</p>
  
  <p>Here is the relevant part of my <code>Google Apps Script</code>:</p>
  
  <pre><code>function doPost(e) {
    var email = e.parameter.Email;
    MailApp.sendEmail({
      to: email,
      subject: "Submission Received",
      body: "We have received your submission. Thank you.",
      htmlBody: HtmlService.createHtmlOutputFromFile(
        "Confirmation"
      ).getContent()
    });
  }
  </code></pre>
  
  <p>How can I solve this so that when my referenced <code>form</code> <code>input</code> field is empty my script doesn’t produce an error?</p>
  
  <p>(I know that one way to solve this is to put <code>required</code> attribite on the <code>input</code>, but the field is optional, so that doesn’t fix my problem.)</p>