0
특정 라벨이있는 모든 이메일을 처리하는 Google Apps 스크립트를 작성하려고합니다.Gmail 스레드 개체 예기치 않은 동작
GmailApp.search 함수를 사용하여 관련 이메일을 모두 검색하지만 GmailThread class에있는 함수 문서를 사용하려고하면 함수를 찾을 수 없다는 오류 메시지가 나타납니다.
내 코드는 다음과 같습니다.
var incoming = "To_Bot"
function readBotsEmail()
{
var emails = GmailApp.search("label:" + incoming);
Logger.log("This is the 'emails' object:" + emails)
var emailsLoopIndex = 0
for (var email in emails)
{
emailsLoopIndex += 1;
try
{
Logger.log("iteration " + emailsLoopIndex + " " + email.getMessageCount());
}
catch(e)
{
Logger.log("iteration " + emailsLoopIndex + " " + e);
}
}
}
다음은 로거 출력입니다.
[14-01-26 03:40:00:909 EST] This is the 'emails' object:GmailThread,GmailThread
[14-01-26 03:40:00:911 EST] iteration 1 TypeError: Cannot find function getMessageCount in object 0.
[14-01-26 03:40:00:914 EST] iteration 2 TypeError: Cannot find function getMessageCount in object 1.
어디로 잘못 가고 있습니까?
답장을 보내 주셔서 감사합니다. 나는 오늘 나중에 이것을 시도 할 것이다. 이제이 꼬임이 해결 되었으니, 이것으로 놀아보고 어디를 가는지 볼 수 있습니다! – Person93
오신 것을 환영합니다 ... 잠시 답을 생각해보십시오. 고마워 –