简体   繁体   English

使用 Google Apps 脚本发送的 G Suite 电子邮件未发送“邮件已阻止”

[英]G Suite Emails Sent with Google Apps Script Are Not Delivered "Message Blocked"

I have a few scripts that run in Google Apps Script.我有一些在 Google Apps Script 中运行的脚本。 I was hitting the quota for time-based triggers on my free consumer account.我在我的免费消费者帐户上达到了基于时间的触发器的配额。 So I signed up for G Suite to get larger quotas.所以我注册了 G Suite 以获得更大的配额。 The scripts are working, but the emails the scripts send (to my personal gmail account) are not delivered.脚本正在运行,但脚本发送的电子邮件(到我的个人 gmail 帐户)未送达。 They are returned with this message:他们返回此消息:

Message blocked Your message to *******@gmail.com has been blocked.消息被阻止 您发送给 *******@gmail.com 的消息已被阻止。 See technical details below for more information.有关更多信息,请参阅下面的技术细节。

The technical details link gives no useful information.技术细节链接没有提供有用的信息。 Google support was not helpful either.谷歌支持也没有帮助。 They told me to search Stack Overflow.他们让我搜索 Stack Overflow。

I can send emails manually and receive emails manually.我可以手动发送电子邮件和手动接收电子邮件。 I have done so with the email address that the script is emailing to.我已经使用脚本通过电子邮件发送到的电子邮件地址这样做了。 But doing that did not change anything.但这样做并没有改变任何事情。 Messages sent with any script are being blocked.使用任何脚本发送的消息都被阻止。 I appreciate the help.我很感激你的帮助。

Here is the code that sends the email:这是发送电子邮件的代码:

function testSendingEmail() { // This sends me an email
var emailAddress = "******@gmail.com"; var message = "This is a test message sent by G Suite."; var subject = "G Suite Test Message"; MailApp.sendEmail(emailAddress, subject, message); Logger.log(emailAddress, subject, message); }

I have tested this with two different gmail addresses.我已经用两个不同的 gmail 地址对此进行了测试。 One gives the Message Blocked message immediately.一个立即给出消息阻塞消息。 The other email was not delivered, but I did not receive the Message Blocked message on that one.另一封电子邮件没有送达,但我没有收到那封邮件被阻止的消息。

(1) the desired behavior: I want the email to be delivered. (1) 期望的行为:我希望发送电子邮件。 It worked fine before I switched to G Suite.在我切换到 G Suite 之前它运行良好。 (2) a specific problem or error: The email messages sent from G Suite by a Google Apps Script are not being delivered. (2) 特定问题或错误:通过 Google Apps 脚本从 G Suite 发送的电子邮件未送达。 (3) the shortest code necessary to reproduce it in the question itself: I added the code. (3) 在问题本身中重现它所需的最短代码:我添加了代码。

I confirm that MailApp.sendEmail() was working in Gsuite in September 2018 but since sometime in October 2018 and until today, MailApp.sendEmail() only works from a Gmail account.我确认 MailApp.sendEmail() 于 2018 年 9 月在 Gsuite 中工作,但从 2018 年 10 月的某个时间开始直到今天,MailApp.sendEmail() 仅适用于 Gmail 帐户。 However, GmailApp.sendEmail() works from either a Gmail or a Gsuite account.但是,GmailApp.sendEmail() 可以通过 Gmail 或 Gsuite 帐户运行。 The solution was given in this thread : MailApp.sendEmail() in Google Apps Script not sending email该线程中给出了解决方案: MailApp.sendEmail() in Google Apps Script not sent email

I came up with a work around.我想出了一个解决办法。 I wish I didn't have to, but I was unable to get any help from Google or figure the problem out myself.我希望我不必这样做,但我无法从 Google 获得任何帮助或自己解决问题。 Instead of having G Suite use Google Apps Script MailApp service to email my personal email address directly, I have G Suite Google Apps Script email itself (the email notification is sent to G Suite's own email address).我没有让 G Suite 使用 Google Apps Script MailApp 服务直接通过电子邮件发送我的个人电子邮件地址,而是使用 G Suite Google Apps Script 电子邮件本身(电子邮件通知发送到 G Suite 自己的电子邮件地址)。 I include a secret code in the message.我在消息中包含了一个密码。 Then I have a gmail filter in the G Suite account that forwards messages with the secret code to my personal email address automatically.然后我在 G Suite 帐户中有一个 Gmail 过滤器,它会自动将带有密码的邮件转发到我的个人电子邮件地址。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应用程序脚本不发送 email 包含指向给定 G Suite 域上的 Google Drive 文件的链接,没有错误消息 - Apps script does not send email containing links to Google Drive files on a given G Suite domain, no error message 是否可以将 Google Apps Script Web App 发布到 G Suite Marketplace? - Is it possible to publish a Google Apps Script Web App to G Suite Marketplace? 事件保存/更新时的 g-suite Google 日历应用程序脚本 - g-suite Google Calender Apps script On Event Save/Update 有G Suite / Google Apps API吗? - Is there a G Suite/Google Apps API? 使用 Google Apps 脚本从 G Suite 管理控制台中删除 web 应用程序 - Remove the web apps from the G Suite Admin Console by using Google Apps Script 在 G-Suite Enterprise 的 Google Apps 脚本中显示 Google Picker,无需访问 GCP - Show Google Picker in a Google Apps Script in G-Suite Enterprise without access to GCP 如何获取使用 Google Apps 脚本的 G Suite 用户列表? - How to get a list of G Suite users which are using Google Apps Script? 如何将 Google Apps Script Web 应用程序发布到 G-Suite Marketplace? - How to publish a Google Apps Script web app to the G-Suite Marketplace? Google Apps脚本 - 重新发送电子邮件 - Google Apps Script - Relabeling Emails Google Apps脚本可在Google电子表格中输出每个用户每周发送的电子邮件数量 - Google Apps Script to output in a google spreadsheet the number of emails sent by each user each week
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM