Using Google Apps Script ( http://script.google.com ), I know from Docs how to send, forward, forward error messages, etc., but I didn’t find how to remove the file attachment via email , then there is:
- save text content (either in HTML format or just in plain text).
- save original sender, save recipient
- keep the original date / hour of the message (important!)
- remove attachment
If this is not possible using the API, is there a way to send a message to myself while keeping 1, 2, and 3?
Note: the class GmailAttachmentlooks interesting and allows you to list recipients:
var threads = GmailApp.getInboxThreads(0, 10);
var msgs = GmailApp.getMessagesForThreads(threads);
for (var i = 0 ; i < msgs.length; i++) {
for (var j = 0; j < msgs[i].length; j++) {
var attachments = msgs[i][j].getAttachments();
for (var k = 0; k < attachments.length; k++) {
Logger.log('Message "%s" contains the attachment "%s" (%s bytes)',
msgs[i][j].getSubject(), attachments[k].getName(), attachments[k].getSize());
}
}
}
but I can not find how to remove the attachment.
. , ( -, , Thunderbird + Attachment extractor plugin ..), . Google Apps Script.