使用 sendEmail 时可以更改发件人地址吗? [英] It it possible to change the from address when using sendEmail?

查看:24
本文介绍了使用 sendEmail 时可以更改发件人地址吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有任何选项可以更改使用 MailApp.sendEmail 发送的电子邮件的发件人地址.

I'm wondering if there are any options for changing the FROM address of an email sent using MailApp.sendEmail.

我构建了一个作为 Web 应用程序发布的表单.学生填写并提交表格,并收到一封电子邮件.我了解如何更改电子邮件的回复地址和发件人姓名.我知道电子邮件使用我的地址作为发件人地址,因为我是脚本的所有者并且应用程序以我的身份运行.

I've built a form that's published as a Web App. Students fill out and submit the form, and receive an email. I see how to change the email's reply-to address and sender name. I know that the email's using my address as the From address since I'm the script's owner and the app runs as me.

有没有办法将发件人地址设置为属于另一个人,在这种情况下,是教师?我假设实现此目的的一种方法是让他成为脚本所有者并引导他为我们重新发布应用程序,但我宁愿不将其交给他.(据我所知,只有脚本所有者才能发布脚本.)

Is there any way to set the From address to belong to another person, in this case, the instructor? I'm assuming one way to accomplish this is to make him the script owner and walk him through re-publishing the app for us, but I'd rather not hand that over to him. (From what I've seen, only the script owner can publish the script.)

换句话说,我希望发件人地址代表正在为其创建脚本的客户端,而不是编写脚本的程序员.

In other words, I want the From address to represent the client the script is being created for, not the programmer who's writing it.

我知道允许脚本从任何人在阳光下发送电子邮件并不是一个理想的功能.我只是想知道是否有人对如何解决我的问题有建议.

I understand that it's not a desirable feature to allow a script to send email from anyone under the sun. I'm just wondering if anyone has a recommendation for how to solve my problem.

谢谢!

推荐答案

Google 在这方面并不灵活 - 您可以看到的唯一发件人"地址是属于有权运行脚本的用户的地址.

Google is not flexible on this one - the only "from" address that you can see is the one belonging to the user whose authority is running the script.

您可以使用机器人"谷歌帐户,而不是作为程序员"运行,例如 DepartmentRobot@ourdomain.com.您可以自己开发脚本,然后从机器人重新发布它们.

Instead of running as "the programmer", you can use a "robot" google account, something like DepartmentRobot@ourdomain.com. You can develop your scripts as yourself, then republish them from the robot.

在 Google Apps 域中,如果需要,您的管理员可以创建此伪用户并编辑设置以将其从 Google Apps 目录中隐藏.

Within a Google Apps Domain, your admin can create this psuedo-user and edit the settings to hide them from the Google Apps Directory, if that's desireable.

学生收到的电子邮件不会来自他们的教师,也不会来自您.

The email that the students receive won't be from their instructor, but it won't be from you, either.

这篇关于使用 sendEmail 时可以更改发件人地址吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆