Friday, May 25, 2007

Why is there no official GMail API?

I have a client who wants to integrate his web application with gmail. In effect, I simply need to open up a new mail in gmail initiated from an action in our web application. The email needs to have to/cc and subject prefilled and that is it. No more.

But, I cannot find an official API to gmail on http://code.google.com/apis and why is that? There has to be a huge market for this usage. And google seems to have apis for some of their other products.

Of course, there are projects like g4j, but I took a look at the implementation, and it seems rather fragile to me. The author has reverse engineered the protocol, as in the code is calling URLs with parameters as API against gmail. Good work I am sure, but it can easily break when google releases new versions.

Am I missing something here? ...

11 comments:

fadhli said...

maybe you want to check this guy out. He's todoist.com project can be integrated with gmail.

fadhli said...

oopss. here's the link

http://amix.dk/

Padraic said...

i use the gmailthis bookmarklet which does most of what you need:
http://contrapants.org/blog/2005/07/gmailthis.html

aj said...

i dunno the requirements but couldn't you just have a form in your web app and send the email via smtp to smtp.gmail.com w/ TLS support on submit?

Per Olesen said...

Yeah, maybe. The client likes to work in the gmail interface, but I guess the key requirement is to keep all of the email conversations threaded inside gmail account. Including sent mail.

Will sending through gmail smtp server make the mail appear as "sent" mail inside gmail?

Per Olesen said...

To "Padraic": About gmailthis. Thanks for the tip. I will look into it. Will need to incorporate the TO/CC parameters in the script code, but maybe I can find out.

Thanx!

aj said...

Yeah I just sent myself an email using Thunderbird which is configured to use smtp.gmail.com and the sent email is available on the gmail web app.

Per Olesen said...

Thats cool. Thanks!

RogerV said...

Use this:

http://mail.google.com/mail/?view=cm&fs=1&tf=1&to=+MAILADDRESSGOESHERE

this is in http://SwiftCRM.com

Alex Mansfield said...

I don't know if you're still looking for a solution, but you might want to look into the IMAP functions in PHP. I've used that to access gmail from external apps. Sending via IMAP should put the message into gmail as expected rather than bypassing it like SMPT would.

Per Olesen said...

@alex: Not looking anymore myself. But a good suggestion to use IMAP.