I've been frolicking around sending emails from Google Spreadsheet.

The sent email has two requirements to fill:

  • It needs to be send from my work-alias
  • It needs to be as HTML

I can do the former with:


Given a proper definition of 'alias', that works very well.

I can do the latter with:


But, perhaps you guessed it:

  • GmailApp doesn't seem to support the HTMLBody option,
  • MailApp doesn't seem to be able to send e-mail from an alias.

Did I do something wrong? Did I search the wrong place? Is there a way around this?

1 Answer 1


Both API's, GmailApp and MailApp, have the possibility to send a HTML body via the advanced options. I used below code and was able to send HTML formatted text through both of them.


// global var 
var html =  
    '<body>' + 
      '<h2> Test </h2><br />' +
        '<p> Greetings Earthling </p>' +

function testGmailApp() {  
    '[email protected]',         // recipient
    'test GmailApp',                 // subject 
    'test', {                        // body
      htmlBody: html                 // advanced options

function testMailApp() {
    '[email protected]',         // recipient
    'test MailApp',                  // subject 
    'test', {                        // body
      htmlBody: html                 // advanced options


enter image description here


  • Thank you! It works wonder well, even with the from: advanced option. I really have no clue what I did wrong in the first place.
    – Gauwain
    Commented Jan 20, 2014 at 10:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.