google-apps-script - 如何在 Google Apps 脚本中找到我的收件箱中的所有电子邮件,然后将电子邮件发送到这些电子邮件?
问题描述
我正在尝试使用 Google Apps 脚本制作 GMail 订阅服务。我希望它向我收件箱中的每一封电子邮件发送一封电子邮件。我该怎么做?
解决方案
function replyToInboxMessages() {
const threads = GmailApp.getInboxThreads();
threads.forEach(t => {
t.getMessages().forEach(m =>{
GmailApp.sendEmail(m.getFrom(),'Return Email','Quit Sending us Email');
});
});
}
推荐阅读
- kendo-ui - 如何异步绑定到 Kendo UI 控件?
- sql - 在 Amazon Athena 中按索引选择行
- python - OSError: [Errno 27] 文件太大
- html - 跨浏览器 SVG 文本基线对齐
- java - 弹性搜索在从另一个索引创建索引时丢失了一些文档
- r - R readr::read_csv 永远读取一个向量
- javascript - 在电子表格中可视化嵌套的 JSON 对象
- ruby-on-rails - ArgumentError:参数数量错误(给定 0,预期 2..3)
- cassandra - 在 cassandra 集合内存储计数器
- php - 会话的未知索引