简体   繁体   English

自动发送来自不同发件人的电子邮件

[英]Automated Send emails from different sender

Created automated emails in Google Sheet Javascript and this automatically send to customer.在 Google Sheet Javascript 中创建自动电子邮件,并自动发送给客户。 I want the sent emails coming from sales reps NOT from me.我希望发送的电子邮件不是来自我的销售代表。 I don't how to do it or is it possible to be done.我不知道该怎么做,或者有可能做到。

Thank you!谢谢!

You can use this script to achieve your target:您可以使用此脚本来实现您的目标:

function sendEmail() {
  var aliases = GmailApp.getAliases()
  Logger.log(aliases); //returns the list of aliases you own
  Logger.log(aliases[0]); //returns the first alias you set
  
  GmailApp.sendEmail('<recipient_email>','<subject_of_email>', '<message_body>', {'from': aliases[0]});
}

Things to do:要做的事情:

  • Replace on <recipient_email> the recipient's email address.替换 <recipient_email> 收件人的电子邮件地址。
  • Put your subject in <subject_of_email>将您的主题放在 <subject_of_email> 中
  • Put your message body in <message_body>将您的消息正文放在 <message_body> 中

See this link for reference in creating the script: https://developers.google.com/apps-script/reference/gmail/gmail-app#sendEmail(String,String,String,Object)请参阅此链接以获取创建脚本的参考: https : //developers.google.com/apps-script/reference/gmail/gmail-app#sendEmail(String ,String,String, Object)

Setting alias through Admin Console:通过管理控制台设置别名:

  • In your Google Admin console (at admin.google.com)...在您的 Google 管理控制台(位于 admin.google.com)中...

  • Go to Users.转到用户。

  • In the Users list, find the user.在用户列表中,找到用户。

  • Click the user's name to open their account page.单击用户名以打开其帐户页面。

  • Click User information and then Alternate email addresses (email aliases).单击用户信息,然后单击备用电子邮件地址(电子邮件别名)。

  • Click Alternate email and enter an alternate username (the part of the address that appears before the @ sign).单击备用电子邮件并输入备用用户名(地址中出现在 @ 符号之前的部分)。 Note: You can't create an alias currently assigned to someone else, either as a primary address or alias.注意:您不能创建当前分配给其他人的别名,无论是作为主要地址还是别名。

  • (Optional) If multiple domains have been added in your Admin console, the field to the right of the @ sign is a menu listing available domains. (可选)如果您的管理控制台中添加了多个域,@ 符号右侧的字段是列出可用域的菜单。 Select a domain for the alias address.为别名地址选择一个域。 Note: Domains added as a domain alias don't appear in this list.注意:作为域别名添加的域不会出现在此列表中。 A domain alias applies for everyone in your account and can't be customized for a single user.域别名适用于您帐户中的每个人,不能为单个用户自定义。

  • Click Save.单击保存。

See this link for the full documentation of adding an alias in Admin Console:有关在管理控制台中添加别名的完整文档,请参阅此链接:

https://support.google.com/a/answer/33327 https://support.google.com/a/answer/33327

After setting the email alias in Admin Console , you should make sure that the alias you created is in the Send Mail As list.在 Admin Console 中设置电子邮件别名后,您应该确保您创建的别名在Send Mail As列表中。 To check this, go to your Gmail->click Settings icon on the upper right corner->See All Settings->Accounts->then Look on the Send Mail As portion and check if your email alias is already in the list.要检查这一点,请转到您的 Gmail->单击右上角的设置图标->查看所有设置->帐户->然后查看将邮件发送为部分并检查您的电子邮件别名是否已在列表中。

[OPTIONAL] If you are just using your personal account for testing, please follow the steps below in Setting the alias in your personal account: [可选] 如果您只是使用您的个人帐户进行测试,请按照以下步骤在您的个人帐户设置别名:

Go to your Gmail->click Settings icon on the upper right corner->See All Settings->Accounts and Import->Add another email address(Then, you can add an alias here)转到您的 Gmail->单击右上角的设置图标->查看所有设置->帐户和导入->添加另一个电子邮件地址(然后,您可以在此处添加别名)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM