我正试图使用Gmail.sendmail发送大约400封电子邮件,并收到消息Exception:Service在一天内调



我只能发送100封电子邮件。工作空间津贴规定,在试用期内,我应该可以发送2000封电子邮件或500封电子邮件。我该如何解决此问题。这对我来说是个问题,因为我也需要能够为大约400人生成带有链接和唯一代码的电子邮件。

这是的脚本

function sendPDFForm()
{
var row = SpreadsheetApp.getActiveSheet().getActiveCell().getRow();
sendEmailWithAttachment(row);
}
function sendEmailWithAttachment(row)
{
var filename= 'RCDocument.pdf';

var file = DriveApp.getFilesByName(filename);

if (!file.hasNext()) 
{
console.error("Could not open file "+filename);
return;
}

var client = getClientInfo(row);

var template = HtmlService
.createTemplateFromFile('email-template');
template.client = client;
var message = template.evaluate().getContent();


//  MailApp.sendEmail({
//    to: client.email,
//    subject: "Message from your Residents" +"' " + "Council",
GmailApp.sendEmail(client.email,'Council election information','Please read the attached ',{attachments: [file.next().getAs(MimeType.PDF)] ,
name: 'Residents Council Election Information '});

}
function getClientInfo(row)
{
var sheet = SpreadsheetApp.getActive().getSheetByName('Sheet2');

var values = sheet.getRange(row,1,row,4).getValues();
var rec = values[0];

var client = 
{
cname: rec[3],
code:  rec[1],
email: rec[0]
};
client.name = client.cname;
return client;
}
function sendFormToAll()
{
var sheet = SpreadsheetApp.getActive().getSheetByName('Sheet2');

var last_row = sheet.getDataRange().getLastRow();

for(var row=1; row <= last_row; row++)
{
sendEmailWithAttachment(row);
sheet.getRange(row,4).setValue("email sent");
}
}

我认为Gmail为第三方应用程序提供了100封电子邮件。我认为只有当你直接通过gmail应用程序发送时,才能获得更大的津贴。这是链接https://support.google.com/a/answer/166852?hl=en这是一张截图请参阅图片

相关内容

最新更新