当我尝试使用 GmailMessage 类的 getPlainBody() 方法时。当我执行以下代码时,出现错误消息“ Invalid MIME type ”。谁能帮我验证我的代码有什么问题?
function processLabel(labelName) {
var targetLabel = GmailApp.getUserLabelByName(labelName);
var targetThreads = targetLabel.getThreads();
return targetThreads;
};
function getEmailPlainText() {
var targetThreads = processLabel('@today');
var threadsCount = targetThreads.length;
for (var i = 0; i < threadsCount; i++) {
var targetThread = targetThreads[i];
var messageCount = targetThread.getMessageCount();
var subject = targetThread.getFirstMessageSubject();
var lastMessage = targetThread.getMessages()[messageCount-1];
var lastMessageContent = lastMessageContent = lastMessage.getPlainBody();
};