TypeError: Cannot find function getFrom in object GmailMessage
TypeError: Cannot find function getFrom in object GmailMessage
我在 Google Apps 脚本中有以下功能:
function getMail() {
var threads = GmailApp.getInboxThreads(0, 50);
var messages = GmailApp.getMessagesForThreads(threads);
var froms = [];
for (var i=0; i<messages.length; i++) {
var msg = messages[i];
Logger.log(msg.getFrom());
}
}
getMessagesForThreads returns GmailMessage 对象列表。
那么为什么它不能访问getFrom方法呢?
function getMail() {
var threads = GmailApp.getInboxThreads(0, 50);
var messages = GmailApp.getMessagesForThreads(threads);
for (var i=0; i<messages.length; i++) {
for (var j=0; j<messages[i].length; j++) {
Logger.log(messages[i][j].getFrom());
}
}
}
getMessagesForThreads
returns GmailMessage[][]
不像我想的那样 GmailMessage[]
。
我在 Google Apps 脚本中有以下功能:
function getMail() {
var threads = GmailApp.getInboxThreads(0, 50);
var messages = GmailApp.getMessagesForThreads(threads);
var froms = [];
for (var i=0; i<messages.length; i++) {
var msg = messages[i];
Logger.log(msg.getFrom());
}
}
getMessagesForThreads returns GmailMessage 对象列表。 那么为什么它不能访问getFrom方法呢?
function getMail() {
var threads = GmailApp.getInboxThreads(0, 50);
var messages = GmailApp.getMessagesForThreads(threads);
for (var i=0; i<messages.length; i++) {
for (var j=0; j<messages[i].length; j++) {
Logger.log(messages[i][j].getFrom());
}
}
}
getMessagesForThreads
returns GmailMessage[][]
不像我想的那样 GmailMessage[]
。