Poll function Write e-mail

by jessekinsman

JavaScript

function sendMailAlert(obj, res, date){
    var message = {}, text;
      text = "<p><strong>ALERT</strong></p>";
      text += "<p>The following url <a href='" + obj.url + "'>" + obj.url + "</a> returned the following code " + res + " on " + date + "</p>";
      message = {
        to: alertAddress,
        from: "[email protected]",
        subject: "Poll server alert!",
        htmlBody: text
      }
      MailApp.sendEmail(message);
}