March 2016
Beginner to intermediate
232 pages
4h 29m
English
You can attach any type of file to your e-mail message by setting options as shown in the following code. The following code attaches the active spreadsheet's left-most Sheet content as PDF.
function sendEmailWithAttachments(){
var file = SpreadsheetApp.getActiveSpreadsheet()
.getAs(MimeType.PDF);
// MailApp.sendEmail(recipient, subject, body, options)
MailApp.sendEmail(
"[[ Recipient email id ]]",
"Chapter 3",
"",
{
attachments: [file],
name: 'Chapter 3 test attachment'
}
);
}Read now
Unlock full access