Skip to content

Instantly share code, notes, and snippets.

@marcospozzo
Last active September 7, 2023 13:21
Show Gist options
  • Save marcospozzo/b60ebde1d92239fcf63c4e32d043e786 to your computer and use it in GitHub Desktop.
Save marcospozzo/b60ebde1d92239fcf63c4e32d043e786 to your computer and use it in GitHub Desktop.
Google Apps Script send email with html body
function sendMail() {
const subject = 'Subject';
const message = 'Message';
const templ = HtmlService.createTemplateFromFile('email'); // filename is email.html
const htmlMessage = templ.evaluate().getContent();
const options = { htmlBody: htmlMessage };
GmailApp.sendEmail(respondentEmail, subject, message, options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment