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

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

问题描述

我想知道是否有更改使用MailApp.sendEmail发送的电子邮件的FROM地址的选项。

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

有没有办法将From地址设置为属于另一个人,在这种情况下是指导者?我假设有一种方法可以实现这一点,那就是让他成为剧本的拥有者,并通过为我们重新发布应用程序来引导他,但我宁愿不把它交给他。 (从我所看到的,只有脚本所有者才能发布脚本)。

换句话说,我希望From地址代表脚本所在的客户端而不是编写它的程序员。



据我所知,允许脚本从太阳下的任何人发送电子邮件是不理想的功能。我只是想知道如果有人有建议如何解决我的问题。



感谢! 您可以看到的唯一的发件人地址是属于正在运行脚本的用户的地址。



不是以程序员身份运行,您可以使用机器人Google帐户,例如 DepartmentRobot@ourdomain.com 。您可以自己开发脚本,然后从机器人重新发布。



在Google Apps Domain中,您的管理员可以创建此伪用户并编辑设置以隐藏他们来自Google Apps目录,如果这是需要的。



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


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

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.

Thanks!

解决方案

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.

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.

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天全站免登陆