I'd like to save an email, along with attachments, from Gmail (Google Apps) to another database for CRM-like functionality. However, according to the docs, "Extractors can not read email attachments". My question: Is it possible to somehow use some type of identifier from the email (such as EmailTimeExtractor) and use that to pull the attachments using IMAP? I'm not very familiar with contextual gadgets yet and just wanted to know if what I'm trying to do is possible before diving in too far!
Asked
Active
Viewed 1,436 times
5
-
1The attachments are not the only thing thats limited. You will also only be able to get the first 1,000 characters of the message body of the message with the gmail-contextual-gadget API – JochenJung Aug 12 '10 at 16:59
3 Answers
1
If you use a standard imap client to pull the email down you'll get the attachment. It'll be one of the parts. Psuedo code:
email = new->email_object();
remote_mailbox = new->imap_object_creator(username, password, ...)
while (email = remote_mailbox->download_next_email) { // this downloads the next email
foreach part_type (email->parts->next) { // this iterates over the parts of the email
if( part_type == 'attachment' ) { // not sure if this is it exactly, but you'll find it in the mime-type
//hooray! you've found an attachment. do what you will with it
}
}
}
When I was doing this I was writing it in Perl so I used the MIME::Tools suite to hold the email and IMAP::Client as my imap client. But any language should have common objects available to represent an IMAP connection and an email.

coffeepac
- 634
- 5
- 13
0
It should be possible to get the email Id from the extractor, then use google apps script GmailAttachment object to get the attachment.

mgmonteleone
- 400
- 1
- 9
0
I believe Attachments.me does exactly this - does that help, or is your need still unmet?

Cooper
- 826
- 9
- 10