function getMail(){ // usernameをご自身のものに書き換えてください var to = 'username+Sync@gmail.com'; var start = 0; var max = 500; // 検索で対象を取得(Toがエイリアスアドレス、未読のもの) var threads = GmailApp.search('to:(username+pomera@gmail.com) is:unread',start,max); for(var n in threads){ var the = threads[n]; var msgs = the.getMessages(); for(m in msgs){ var msg = msgs[m]; var subject = msg.getSubject(); //プレーンテキストの本文を取得 var body = msg.getPlainBody() // ポメラSync可能なメールを送信 var status = GmailApp.sendEmail(to, subject, body); //元のメールをゴミ箱へ if (status) { msg.moveToTrash(); } } Utilities.sleep(1000); } }