0
votes

I'm creating a script with Google Script to perform a multiple email send with personalized text inside the email body (like name and addresses). Is it possible to send the emails with an imported account (in GMail) via script?

Thanks

1
what is "an imported account"? - Adelin
In GMail you can send email with other account like alias... https://support.google.com/mail/answer/22370?hl=en - Zampone

1 Answers

0
votes

You can use send method of GmailApp:

https://developers.google.com/apps-script/reference/gmail/gmail-app#sendemailrecipient-subject-body

sendEmail(recipient, subject, body)

Sends an email message. The size of the email (including headers) may not exceed 20KB.

// The code below will send an email with the current date an time
 var now = new Date();
 GmailApp.sendEmail("[email protected]", "current time", "The time is: " + now.toString());

Also, GmailApp.sendEmail support send from your alias as well.

sendEmail(recipient, subject, body, options) support use options to set options.from = '[email protected]', as document saying:

from: String, the address that the email should be sent from, which must be one of the values returned by getAliases()