当我尝试使用GmailMessage类的getPlainBody()方法时。当我执行以下代码时,会显示错误消息“无效的MIME类型”。任何人都可以帮我验证代码中的错误吗?
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();
};