【问题标题】:MailApp.sendEmail() in Google Apps Script not sending emailGoogle Apps 脚本中的 MailApp.sendEmail() 不发送电子邮件
【发布时间】:2018-10-31 08:39:48
【问题描述】:

我们为我们的客户建立了 Google G Suite,在过去的几周里,我们发现 Google Apps 脚本没有按预期处理 MailApp.sendEmail()。它只发生在新的 G Suite 帐户中,并且现有帐户中的代码完全相同。

function testemail(){
  MailApp.sendEmail("gordon@........", "TEST", "Hello world");
  return;
}

我们使用的电子邮件地址是有效的电子邮件。

有什么想法吗?

【问题讨论】:

  • 看起来是帐户配置错误。尝试比较配置。你最好在webapps stackexchange 中问这个问题。另外,请检查您是否能够从这个新帐户的 gmail 界面发送电子邮件。

标签: google-apps-script


【解决方案1】:

尝试使用GmailApp.sendEmail()

// The code below will send an email with the current date and time.
var now = new Date();
GmailApp.sendEmail("mike@example.com", "current time", "The time is: " + now.toString());

这是现在推荐的。

【讨论】:

  • 奇怪的是 GmailApp.sendEmail() 有效。感谢您的提醒。应该先尝试一下,但对于其他有相同问题的人来说,这是一个很好的说明。具有相同参数的 MailApp.sendEmail 仍然不起作用。可能是我们地区的 Google 服务问题!再次感谢。
猜你喜欢
  • 2021-11-21
  • 1970-01-01
  • 2013-08-15
  • 2020-12-15
  • 2020-05-10
  • 1970-01-01
  • 1970-01-01
  • 2013-08-30
  • 2023-02-07
相关资源
最近更新 更多