Google Apps Script - MailApp
1 answer
It is best to use the first method
sendEmail(recipient, subject, body, options)
This method can accept all of your parameters. You pass all of your parameters in the options part.
It will look something like this.
// Send an email with two attachments:
// a file from Google Drive (as a PDF) and an HTML file.
var file = DriveApp.getFileById('12345mnopqrstuvwxyz');
var blob = Utilities.newBlob('HTML content here',
'text/html',
'my_email.html');
MailApp.sendEmail('mike@example.com',
'Attachment example',
'Two files are attached.',
{
attachments: [file.getAs(MimeType.PDF), blob],
replyTo: 'ReplyTo@Email.com'
});
here is a screenshot of the documentation
+4
source to share