Search code examples
google-apps-scriptgmail

How to format text (bold, italics) in a Gmail email sent via Google Apps Script?


I've just started using Google Apps script. I'm using it to send emails from a Google Apps spreadsheet. In the email I would like some parts made bold and/or italicised but I can't find out how to do it.

PS: This is how I'm concatenating strings should it be of interest:

var message = "Hi " + fname + ",\n\nJust letting you know that we have your job targeted for " + targetDate+ ".\n\nPlease let w know if that is unsuitable.\n\nThanks, Gregg";

Solution

  • You have to use the html body option, see doc here, a search on this forum will return a lot of practical examples...