0

We have a Gmail Contextual gadget that fires on every email. We use it for searching a database based on the email address of either the sender or the reciever.

When we have recieved the email we want to search using the email sender.

When we have sent the email we want to search using the email of the recipient/s.

With the current extractors we can grab the email addresses but how do we know if the email is Sent or Recieved?

Many thanks for your help here.

PNC
  • 1,932
  • 19
  • 36

1 Answers1

1

You can use the message Id to search Gmail IMAP for the given message. You can then determine sender, receiver and folder the message is in. That info should be more than sufficient to determine wether the message was sent or received.

koma
  • 6,486
  • 2
  • 27
  • 53
  • Thanks for the suggestion - we find that IMAP is an expensive resource and we want to do this for every email opened so across a large user base that is a lot of IMAP calls (and IMAP is not all that reliable with Gmail either). Ideally we can do this with javascript in the gadget. We can use a Chrome extension to scrape the DOM but that requires an extension. The other option is to compare the sender email address with that of the current user - although that fails when address an alias has been used. – PNC Jun 20 '14 at 21:57
  • You might be lucky : https://developers.google.com/gmail/api/overview new from io14; – koma Jun 27 '14 at 15:38
  • Thanks koma - having a look at the API now - will certainly be a much better option than IMAP. Has a javascript option which could be used to pull the labels inside from the gadget. – PNC Jun 28 '14 at 08:01