本文介绍了谷歌脚本mailapp.sendEmail只适用于我的电子邮件地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,这很奇怪。我在电子表格中撰写脚本以从当前活动工作表中获取信息,使用模板文件创建报告并将其作为附件发送。



当我使用我的Google应用程序域帐户电子邮件地址作为收件人时,这一切都很完美。当我发送到除我自己以外的任何其他电子邮件地址时,它不起作用。它昨天在工作。运行脚本时不会产生错误



我做的唯一事情就是将电子表格的所有者更改为我们域中的其他用户。我在测试脚本时与其他用户共享。我已经尝试在我们的域中使用其他电子邮件地址,并创建了一个带有sendemail函数的新电子表格,它们都具有相同的行为。

  //通过电子邮件发送指定的报告
函数emailReport(文件,收件人,emailSubject,emailMessage){
MailApp.sendEmail(someone@example.com,emailSubject,emailMessage,
{attachments:文件,mimetype:'application / pdf'});
}


解决方案

回来,甚至在另一个引用它。从那时起,我注意到没有人回复你,所以......



看起来好像谷歌最近已经改变了(虽然没有记录在我找到的任何地方)MailApp .sendEmail功能,以便它只适用于您使用属于电子表格所有者的电子邮件地址。



我的猜测是阻止系统用于未经请求的群发电子邮件。



另一个问题是



(对不起,不是这样的答案:(更多的确认,你看到的似乎是预期的)


Okay this is very strange. I have scripting in a spreadsheet to take information from the currently active sheet, creates a report using a template file and sends it as an attachment.

This all works perfectly, when I use my Google apps domain account email address as the recipient. It doesn't work when I send to any other email address, other than my own. It was working yesterday. No errors generated when the script runs

The only thing that I did was change the owner of the spreadsheet to another user in our domain. It was shared with the other user while I was testing the scripts. I've tried using other email addresses in our domain and created a new spreadsheet with the sendemail function, all with the same behavior.

// Email the specified report
function emailReport(file, recipients, emailSubject, emailMessage) {
 MailApp.sendEmail("someone@example.com", emailSubject, emailMessage, 
              {attachments: file, mimetype: 'application/pdf'});
}
解决方案

I noticed this question a while back, and even referenced it in another one. Since then I've noticed no one responded to you so...

It appears as if Google has recently changed (though not documented anywhere I've found) the MailApp.sendEmail function so that it only works when you use the email address belonging to the owner of the spread sheet.

My guess is this is to prevent the system being used for unsolicited mass emailing.

The other question was here

(Sorry, not an answer as such :( more of a confirmation as to what you are seeing seems to be as expected)

这篇关于谷歌脚本mailapp.sendEmail只适用于我的电子邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 08:17