首页 > 解决方案 > 如何在 Google Apps 脚本中找到我的收件箱中的所有电子邮件,然后将电子邮件发送到这些电子邮件?

问题描述

我正在尝试使用 Google Apps 脚本制作 GMail 订阅服务。我希望它向我收件箱中的每一封电子邮件发送一封电子邮件。我该怎么做?

标签: google-apps-scriptgmail

解决方案


function replyToInboxMessages() {
  const threads = GmailApp.getInboxThreads();
  threads.forEach(t => {
    t.getMessages().forEach(m =>{
      GmailApp.sendEmail(m.getFrom(),'Return Email','Quit Sending us Email');
    });
  });
}

推荐阅读