|
Project Information
Members
Links
|
Gmail4JGmail4J is a simple, object oriented library for accessing Gmail services from Java. News2011-01-05 - Gmail4J 0.4 is out now with many great new IMAP related features! And we have a sync with Maven Central Repository! Use with MavenAdd the dependency to your pom.xml: <dependency> <groupId>com.googlecode.gmail4j</groupId> <artifactId>gmail4j</artifactId> <version>0.4</version> </dependency> Example codeGet unread messagesGmailClient client = new RssGmailClient();
GmailConnection connection = new HttpGmailConnection(LoginDialog.getInstance().show("Enter Gmail Login"));
client.setConnection(connection);
final List<GmailMessage> messages = client.getUnreadMessages();
for (GmailMessage message : messages) {
System.out.println(message);
}Get unread messages via proxyGmailClient client = new RssGmailClient();
HttpGmailConnection connection = new HttpGmailConnection(LoginDialog.getInstance().show("Enter Gmail Login"));
connection.setProxy("proxy.example.com", 8080);
connection.setProxyCredentials(LoginDialog.getInstance().show("Enter Proxy Login"));
client.setConnection(connection);
final List<GmailMessage> messages = client.getUnreadMessages();
for (GmailMessage message : messages) {
System.out.println(message);
}There are more examples in API docs. Maven SiteFor reports, API docs and more, please check Gmail4j Maven Site. Changelog |