title: In Google Apps Script MailApp is it possible to pass javascript in the htmlBody?
body: <p>Not sure if it is possible, but I was playing around trying to pass a simple alert javascript function in the htmlBody. The email arrives with a button, when you click the button, it calls the simple javascript function. This doesn't seem to work and I was wondering if it is simply not permitted by Google? </p>
  
  <pre><code>function sendEmail(){
  
  var body = '&lt;html&gt;&lt;body&gt;&lt;button onclick="myFunction()"&gt;Try it&lt;/button&gt;&lt;script&gt;function myFunction()    {windows.alert();}&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;'
  MailApp.sendEmail("testemail@hotmail.com","test subject", "",{htmlBody: body});
  
  }
  </code></pre>
  
  <p>Thanks!</p>
  
  <p>Shawn</p>