-1

It comes from first question

function emailGoogleDoc(){
var id = DocumentApp.getActiveDocument().getId() ;
var forDriveScope = DriveApp.getStorageUsed(); //needed to get Drive Scope 
requested
var url = "https://docs.google.com/feeds/download/documents/export/Export?
id="+id+"&exportFormat=html";
var param = {
method      : "get",
headers     : {"Authorization": "Bearer " + ScriptApp.getOAuthToken()},
muteHttpExceptions:true,
};
var html = UrlFetchApp.fetch(url,param).getContentText();
Logger.log(html);

var email = person@domain.tld;  
var subject = 'Subject line';
var body = "To view this email, please enable html in your email client.";

MailApp.sendEmail(
    email,           // recipient
    subject,         // subject 
    body, {          // body
    htmlBody: html // advanced options
  }
);
}

Hi! I'm having troubles with this code.

It runs perfect except by the text. It is without bolds or colours.

1 Answers1

0

MailApp.sendEmail({ to: email, subject: subject, htmlBody: html });