电子邮件转发会在Google应用脚本中删除原始发件人的电子邮件地址 [英] email forwarding removes original sender's email address in Google app scripts

查看:163
本文介绍了电子邮件转发会在Google应用脚本中删除原始发件人的电子邮件地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的Google App脚本代码:

Here's my Google App Script code:

var messages = threads[x].getMessages();
for (var y in messages) 
{
  messages[y].forward("someone@example.com");
}

此操作正常,但是将消息的from字段重置为执行脚本的帐户的电子邮件ID.这将删除message的原始发件人的所有凭据.如何更优雅地转发电子邮件,以保留所有原始标头(至少为fromto)?如果原始邮件是发送到人员名单新闻组的,那么我需要将其保留在转发的邮件中.

This forwards fine, but it resets the from field of message to the email id of account which executes the script. This removes all credentials of the original sender of message. How to forward the email more elegantly such that all original headers (at least from and to) are retained? If the original message was sent to a list of people or a newsgroup, I need to retain it in the forwarded message.

推荐答案

通常,转发的电子邮件不会保留发往和发往的原始电子邮件.如果您使用GMail或Outlook转发电子邮件,您会注意到这一点. GMailApp的行为方式相同.

In general a forwarded email does not retain the original from and to address. If you forward an email using GMail or Outlook you'll notice this. The GMailApp is behaving the same way.

这篇关于电子邮件转发会在Google应用脚本中删除原始发件人的电子邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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