Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9704

GMail App Script error [closed]

$
0
0

I'm trying to run a GMail Apps script that I collected from this forum as an answer to the following question about sending messages to Spam in GMail

The script I'm trying to correct is as follows:

var threads = GmailApp.search("label:myspamindicator -is:spam");
for (var iThread = 0; iThread < threads.length; iThread++) {
   var threadId = threads[iThread].getId();
   GmailApp.moveThreadToSpam(threadId);
}

I've put this into a function and am trying to trigger it on a regular basis. The error I get is from just running the function without a trigger,

The idea is to train GMail to recognise all of my spam email by sending the spam messages to the Gmail spam box rather than stay in the inbox and be deleted.

I'm pretty sure I understand the code concept (although completely new language for me), but I'm getting the following error error:

Message details Exception: The parameters (String) don't match the method signature for GmailApp.moveThreadToSpam. (line 5, file "sendtoSpam")

Any idea what I'm doing wrong.


Viewing all articles
Browse latest Browse all 9704

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>