简体   繁体   中英

Using any of the sendEmail functions for the GmailApp class without being blacklisted or having my Gmail account deactivated by Google?

How do I use any of the sendEmail functions for the GmailApp class ( https://developers.google.com/apps-script/reference/gmail/gmail-app ) together with Google Sheets mail merge to send custom emails to the customers of my business without being blacklisted or having my consumer Gmail account deactivated by Google?

Will the customers in some way accept being emailed in this way? If so, how do they do this?

Let's imagine you have a Spreadsheet where column A contains a number of E-Mail addresses. You can the use the SpreadsheetApp to get all those E-Mail addresses and send a E-Mail to each one.

const listOfEmails = SpreadsheetApp.getActiveSheet().getDataRange().getValues();
const subject = "Hi :)"
const body = "Hi, I am sending you this through a script";

listOfEmails.forEach( emailRow => {
   GmailApp.sendEmail( emailRow[0], subject, body )
});

There you see how SpreadsheetApp and GmailApp work together. This is the most basic example. There is a whole lot more you can do, for example sending out Drafts from your Gmail, or merging data from Sheets into the E-Mail.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM