测试没问题,利用自动回复来自 @txt.voice.google.com 的邮件实现自动发短信
从网上找到的教程 https://www.reakk.com/archives/23.html
不过亲测里面的自动代码用不了,找了个能用的,直接替换就行
function autoReplier() { var labelObj = GmailApp.getUserLabelByName(‘autoreply’); var gmailThreads; var messages; var sender; for (var gg = 0; gg < labelObj.getUnreadCount(); gg++) { gmailThreads = labelObj.getThreads()[gg]; messages = gmailThreads.getMessages(); for (var ii = 0; ii < messages.length; ii++) { if (messages[ii].isUnread()) { msg = messages[ii].getPlainBody(); sender = messages[ii].getFrom(); MailApp.sendEmail(sender, "Auto Reply", "Hi,this is Oliver"); messages[ii].markRead(); messages[ii].moveToTrash(); } } } }
注意测试成功以后,可以把触发器的频率设置低一点,不然你可能和机器人互相一直循环问候,哈哈哈 建议一周一次
|