Mail4ME is a
lightweight implementation of the popular SMTP, POP3 and IMAP protocols - including
MIME support - allowing wireless J2ME/MIDP devices to access the
e-mail service at any time, and from any place. The package is suitable for running
on top of J2ME as well as J2SE, so it is also a tiny alternative to JavaMail.
The source includes a MIDlet for doing e-mail on an MIDP-enabled device. It allows to
browse through one's POP3 or IMAP inbox, read the individual messages and compose and
send new ones. The MIDlet makes use of the MIME features and thus is able to display
messages composed of text and PNG pictures.
Mail4ME has been covered in the
German Java Spektrum magazine. This
is a special edition with a focus on mobile Java, so we're in good
There will also be a new release soon with all the fixes sent
in by helpful folks over time. Watch out for announcements on this page.
May 26, 2002
Mail4ME now has support for MIDP devices that speak HTTP only. For the client side there's a
new connection class that allows tunneling of plain TCP through HTTP. This class works just like
the connection classes for J2ME and J2SE, apart from the fact that you have to instantiate it
manually (may change in the future). For the server side there's a small servlet that acts as a proxy
for Mail4ME. The servlet requires a HTTP/1.1 compliant web server. It has been tested successfully
with Tomcat 4.0, but doesn't work properly with 3.x versions of Tomcat. A sample web.xml
file for Tomcat is in CVS and on the download page.
May 10, 2002
Mail4ME is famous now: The June issue of Dr. Dobbs has an
in-depth article about the project, including a tutorial on how to use it in your
own projects. Two remarks on this:
If you've already read the article and are now wondering where to find the
SmtpException and Pop3Exception classes: They have
been collapsed into one single exception class MailException. With the
advent of the ImapClient class it simply didn't seem practical to have one
exception class per protocol any more. The InboxClient class can be used as
a common abstraction for the POP3 and IMAP clients, making run-time selection of a protocol
Unfortunately, a small typo has made it into listing six on page 44, line 3: It should be
if (count == 0) where the listing says if (int i == 0). Thanks
to Adam Anderson for pointing this out. Note that the sample's correct source code is in CVS as
well as in the ZIP on the download page.
I also decided to restructure the source code a bit: The samples are now in their own directory. And I
did improve the memory behaviour of the low-level communications code. For J2ME this means you
should be able to download larger messages now before getting an OutOfMemoryException.