g4j - GMail API for Java

GMailer API for Java (g4j) is set of API that allows Java programmer to communicate to GMail. With G4J programmers can made Java based application that based on huge storage of GMail.

An Email application, GMailer for Java is also built to demonstrate the usage of the API. It is planned to include minimalist email capabilities such as browse, search, read, send mail and download attachment.

This software is distributed in GNU General Public Lincense (GPL).


The g4j package includes the library, the Email application and javadocs. The g4j-deps package is required if you want to compile g4j. Current version of API is 0.3.12 and Email application is 0.3.4.

For latest source code you can Browse CVS Repository or get the CVS by:

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/g4j login

cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/g4j co src

Check the project statistics, woo we've made 10000+ lines of code in a month!

Release Notes 0.3.12

G4J finally support the new contact list interface! (read only)

Matthias fix bug in GMailer that scroll the message to bottom. He have also added open browser function, the links in messages now clickable!

You would need Java Runtime Environment (JRE) to run this software, download it in http://java.sun.com/

To use the software, run g4j.bat on Windows or g4j.sh on Unix. To Use the library include the g4j-lib.jar in your programs.

If you encounter error message: "sun.security.validator.ValidatorException: No trusted certificate found" while connecting gmail, please read the solution.

This program is developed mainly in Windows XP & 2000, it have not been tested on other platforms. If you encounter any problem please post a message in project support page.


Set of API that allows Java programmer to communicate to GMail. API is avaliable online.

GMailer for Java

Minimalist Email client that retive email from Gmail.



This project is inspried and motivated by GMailer for PHP and Gmail Agent API , their great works make me want to have an Java Implementation of their kind. Their open sources also made the understanding of GMail's protocol much easier, Thank You!

This project is not possible without following open source softwares:

Support and Contribution

If you have any problem, opinion, or software that built on g4j, please tell me via email or Sourceforge Forum!

Thanks Teodor and Samanth to join this project! They would help me to make GMailer more usable and I can focus more on the G4J API.

If you can join us, send me an email. You can also browse the todo list and give us suggestions!

Related Projects

About Me

I am a tiny programmer in a big enterprise in Hong Kong.

Read my blog in www.siuying.net ( Chinese Content )