Last active
September 7, 2023 13:21
-
-
Save marcospozzo/b60ebde1d92239fcf63c4e32d043e786 to your computer and use it in GitHub Desktop.
Google Apps Script send email with html body
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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