Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function makeFolderDrive(){
- const folder = DriveApp.createFolder('Załączniki z mailów');
- const threads = GmailApp.search('has:attachment');
- const attachments = [];
- threads.forEach(thread => {
- thread.getMessages().forEach(message => {
- const senderEmail = message.getFrom();
- message.getAttachments({includeInlineImages: false}).forEach(attachment => {
- const file =
- folder.createFile(attachment.copyBlob().setName(senderEmail + " - " + attachment.getName()));
- attachments.push(senderEmail + " - " + attachment.getName());
- })
- })
- })
- Logger.log(attachments);
- }
Advertisement
Add Comment
Please, Sign In to add comment