问题描述
最近,我决定从基本的免费gmail帐户升级到GSuite帐户.我有一组Google AppsScripts,它们可以管理表单/电子表格的集合,并发出有关更改的通知.所有脚本均已复制到新的GSuite帐户中,并且似乎运行良好.使用的所有API(电子表格,日历,驱动器,表格)均与script.send_mail一起使用,该脚本拒绝将任何电子邮件发送到外部电子邮件地址.如果我将其设置为向自己发送电子邮件,则可以正常工作,但对任何外部电子邮件都可以邮件被此邮件屏蔽
Recently I have decided to upgrade to a GSuite account from the basic free gmail account. I have a collection of Google AppsScripts that manage a collection of forms/spreadsheets and send out notifications on changes.All scripts were copied into the new GSuite account and all seem to run well. All APIs used (spreadsheet, calendar, drive, forms work with the except of the script.send_mail which refuses to send any emails to external email addresses. If I set it to send emails to myself, it works fine, but to any external email and the message gets blocked with this message
Action: failed
Status: 5.0.0
Diagnostic-Code: smtp; Message rejected. See https://support.google.com/mail/answer/69585 for more information.
Last-Attempt-Date: Mon, 30 Sep 2019 14:02:02 -0700 (PDT)
我创建了一个非常简单的脚本来对其进行测试,但该脚本仍然失败.附带的代码:
I have created a very simple script to test it and it still fails. Code attached:
function testSendMsg(){
var subject = "Test Message";
var message = " Testing 1 2 3..";
var emailAddr = "[email protected]"; // put correct email address here
MailApp.sendEmail(emailAddr,subject,message);
}
使用浏览器邮件应用程序发送此电子邮件可以正常工作,只有基于脚本的电子邮件发送失败.对此有任何帮助或指点.
Sending this email using the browser mail app works fine, only the script based email sends fail. Any help or pointers on this is appreciated.
Google云支持无法找到任何解决方案!
Google Cloud Support was not able to find any solutions to this!
推荐答案
经过一个星期的挫败,试图弄清为什么它不起作用,它直到今天才开始工作且没有任何变化.我怀疑一个新的GSuite帐户由于某种我无法想象的原因而被阻止在开始使用此API,然后在试用期结束后最终被释放.
After a week of frustration trying to figure out why this was not working, it just started working today with no changes. I suspect a new GSuite account is blocked from using this API at the beginning for some reason that I can not imagine and then released eventually after probation period is over.
这篇关于MailApp.send通过电子邮件发送所有阻止的邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!