Google Apps脚本不允许我发送外发电子邮件

时间:2022-02-25 18:15:04

This simple script should send an e-mail to the prescribed e-mail address ; however, it only works if the emailAddress I used is my logged in gmail account. If I change that e-mail address to anything other than the e-mail address that I am currently logged in as, like my other msn/gmail accounts, it fails. The tutorials given seem to demonstrate that you can send e-mails to anyone.

这个简单的脚本应该发送电子邮件到规定的电子邮件地址;但是,它只适用于我使用的emailAddress是我登录的Gmail帐户。如果我将该电子邮件地址更改为我当前登录的电子邮件地址以外的任何其他地址,就像我的其他msn / gmail帐户一样,则会失败。给出的教程似乎表明您可以向任何人发送电子邮件。

My code:

function sendEmails() {
    var subject = "Homework Update"
    var messageBody= "testing the message";
    var emailAddress = "example1@gmail.com";
    MailApp.sendEmail(emailAddress,subject,messageBody);
}

Error Message: "Failed to send email to example@gmail.com (line 7, file "Code")Dismiss"

错误消息:“无法向example@gmail.com发送电子邮件(第7行,文件”代码“)解除”

1 个解决方案

#1


0  

I tried running the script while logged in with a different e-mail account and the script worked fine. I investigated further and found that my domain administrator does not have mail enabled for our google accounts. I work at a school and we use Microsoft Exchange server for e-mail. I will be contacting the IT department tomorrow to see if there is anyway I can get the mail application enabled for scripting. Hopefully this post will help anyone with a similar problem.

我尝试使用不同的电子邮件帐户登录时运行脚本,脚本运行正常。我进一步调查,发现我的域管理员没有为我们的Google帐户启用邮件。我在一所学校工作,我们使用Microsoft Exchange服务器收发电子邮件。我明天将联系IT部门,看看是否有我可以启用脚本的邮件应用程序。希望这篇文章可以帮助任何有类似问题的人。

#1


0  

I tried running the script while logged in with a different e-mail account and the script worked fine. I investigated further and found that my domain administrator does not have mail enabled for our google accounts. I work at a school and we use Microsoft Exchange server for e-mail. I will be contacting the IT department tomorrow to see if there is anyway I can get the mail application enabled for scripting. Hopefully this post will help anyone with a similar problem.

我尝试使用不同的电子邮件帐户登录时运行脚本,脚本运行正常。我进一步调查,发现我的域管理员没有为我们的Google帐户启用邮件。我在一所学校工作,我们使用Microsoft Exchange服务器收发电子邮件。我明天将联系IT部门,看看是否有我可以启用脚本的邮件应用程序。希望这篇文章可以帮助任何有类似问题的人。