2

For months I have used this little script to auto reply to clients but on may 2 it started returning empty values. Did google change something or did I mess something up?

The body and the subject are still returned as normal. However, reply to email-ID is blank.

Below is the relevant code:

 var message = GmailApp.getMessagesForThread(label[i]);

    var body = message[0].getPlainBody(); 
    //   Logger.log(body);
    var email = message[0].getReplyTo(); 
       Logger.log(email);
       Logger.log(sub);

Thanks for the help guys.

3
  • This could be in response to this phishing malware, maybe damage control? Just to be clear, this my speculation/theory, I could be completely wrong!
    – Jack Brown
    May 7, 2017 at 0:53
  • You should report it as an "issue" on the issue tracker. Link to Issue Tracker
    – Alan Wells
    May 7, 2017 at 1:05
  • I did that at the time. I am really confused, a google script function stops working and nobody knows why. How long will it take for the google team to notice my issue? May 16, 2017 at 0:39

1 Answer 1

1

try this

function getMail(){

var myspreadsheet = SpreadsheetApp.openById('*************');
var mysheet = myspreadsheet.getSheets()[0];
//0~99まで
var threads = GmailApp.getInboxThreads(0 , 500);
var messages = GmailApp.getMessagesForThreads(threads); 
var froms = [];
var row = mysheet.getLastRow()+1

messages.get

for(var i = 0; i < threads.length; i++)
{
froms.push([messages[i][0].getFrom(),messages[i][0].getSubject()]);
}

mysheet.getRange(mysheet.getLastRow()+1,1,threads.length,2).setValues(froms);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.