Skip to content

Instantly share code, notes, and snippets.

View mrklein's full-sized avatar

Alexey Matveichev mrklein

View GitHub Profile
@mrklein
mrklein / apps_script_extract_inline_images_from_gmail.js
Created October 8, 2012 12:40 — forked from anonymous/apps_script_extract_inline_images_from_gmail.js
Google Apps Script quick hack to extract inline images from Gmail
function fetchInlineImage() {
var results = GmailApp.search("Subject: Inline Image Test");
for(var i in results) {
var thread = results[i];
messages = thread.getMessages();
for(var j in messages) {
var msg = messages[j];
var pattern = /<img.*src="([^"]*)"[^>]*>/;
var matches = pattern.exec(msg.getBody());