google apps script - Exceeding maximum subject length using message.forward -
i have searched site, , web, have had no joy.
i have google apps script attached spreadsheet (among other things) forwards emails given label given email address. sent email long subject line, , script has started failing on following line of code:
msgstostore[l].forward(emailaddress);
the error receive "argument large: subject"
the subject of original email 283 characters. forwarding message within gmail web interface works without difficulty, adding "fwd: " beginning expect. subject contains ampersand, otherwise not unusual.
i need can use other .forward, or way of modifying message object before forwarding it, can't find documentation maximum size is.
any appreciated.
trim subject:
trimmed_subject = msgstostore[l].getsubject().substring(0, 250) msgstostore[l].forward(emailadress, { subject: trimmed_subject, });
more details: https://developers.google.com/apps-script/reference/gmail/gmail-message#forward(string,object)
Comments
Post a Comment