Jakarta has announced the first release of the Commons-Email package, which aims to simplify the use of JavaMail to send for application programmers. Commons-Email enables developers to send single emails without having to know or understand the underlying protocols.
- Posted by: Joseph Ottinger
- Posted on: September 28 2005 10:04 EDT
The examples page has examples of sending simple (single-part) mail, multipart mail, and HTML mail.
Note that Commons-Email doesn't have a wrapper for reading Email, and will not, according to the project charter.
One aspect of this project is that it's a fulfillment of what JavaMail was intended to be: the basis for wrapper libraries that targeted specific functionality. JavaMail itself is a low-level abstraction of message transport, and as such has capabilities for different purposes (i.e., sending single messages or mass mailings, both of which tend to have very different requirements).
What do you think of the API? Is it sufficient for your needs? What capabilities would you prefer it have (if any?) How does it compare to other mail-sending packages?
- was waiting for this... by dylan stamat on September 28 2005 11:24 EDT
- Jakarta Commons-Email 1.0 released by Ali Kianzadeh on September 28 2005 12:04 EDT
- Stream as Attachment? by Netanel Weinberg on September 28 2005 12:44 EDT
- When is SUN going to release packages that do not require common by The Industry Observer on September 28 2005 14:22 EDT
- When is SUN going to release packages that do not require common by bad mASH on September 28 2005 14:52 EDT
- When is SUN going to release packages that do not require common by Jon Kofal on September 29 2005 02:11 EDT
- Jakarta Commons-Email 1.0 released by Dejan Krsmanovic on September 28 2005 14:39 EDT
- Why no email reading ? by Jim Lee on September 28 2005 22:00 EDT
- How to create mail ? ( make sure my e-mail not spam mail ) by somkiat puisungnoen on September 29 2005 22:53 EDT
- No way for create a email account using Poor javamail :( by lyo Yashnoo on October 04 2005 09:01 EDT
- Jakarta Commons-Email 1.0 released by Tuan Jean Tee on October 04 2005 20:04 EDT
- Does the job, just fine by xavier Cosyns on October 05 2005 11:51 EDT
... for months. It took a while, but it's a great package, and definitely worth the wait.
This is really good package...launchad by jakarta..
i have read the whole API and it sounds good.
From the looks of it, it does everything we need. We have a mail component in our web application which over time has accumulated lots of features. It needs to be replaced (and refactored) for new features and to say the least, javax.mail has not been a pleasure to work with so far and is part of the reason for the sorry state this component is in currently. We already use lots of apache commons stuff and email will be a very welcome addition.
Wow, there are only 8 classes to this entire package. It's amazing how easy and simple API's can be when there are few choices. This is unlike other common libraries where there are 100's of classes for something seemingly simple.
The API has good wrapper classes for example HTML emails.
But the API was needed more is classes for creating Email account or aliases.
Right now there is not Standard API for connecting to SMTP Server to create an Email account or forwarder and so on.
This is nice. Makes simple tasks simple and complex ones impossible, which is ok for most apps, including most of ours. At first glance through the javadocs i missed the possibility to attach inputstreams to the email, but then i saw ByteArrayDataSource and the world was fine again ;-)
Is it possible to attach to the email a pdf file returned as a stream from servlet?
Yes. Create a MultiPartEmail and invoke the method
attach(javax.activation.DataSource ds, java.lang.String name, java.lang.String description)
where the DataSource is ByteArrayDataSource
Why does every Standard Java package require a wrapper. It seems that every API coming out of JSR requires a FACADE to just use it.
Why does every Standard Java package require a wrapper. It seems that every API coming out of JSR requires a FACADE to just use it.SAD!!!
NO -- it doe snot REQUIRE it. But you may want to do this for additional flexibility. Say yo want tio use Ristretto instead on Sun's javamail
I guess the answer to your question is never, because some people cannot understand JSR APIs or follow basic instructions on how to use them. (the stork delivers the baby to the parents is what we learn as children, and when we're old enough we learn the real story).
I for one am disappointed that Apache EMail API did not use Commons Logging ;-)
What capabilities would you prefer it have (if any?)
Does it support getting Mail Sessions from JNDI? I couln't find that in documentation and it is pretty common when running inside app server.
A wrapper for easy email reading would be great. Wonder why such nice complementary features not planned.
How to create mail ? ( make sure my e-mail not spam mail )
Is it posible to do that ?
I think there is no such method to create a email account using javamail. So javamail is not useful in enterprise application or web application! Create a email account is a common function for a email system,it's right?
So JavaMail is bad and poor API ,it is not be used in a true email system. It's used for student or for test only.
It will be great to incorporate function such as queuing mechanism to ensure email is being sent when there are problems with the network connection or SMTP email server.
It's a great email sending package, it allowed me to write an extension for sending templated internationalized mails in just a few hours.
Having worked with javamail a few years ago, I can assure that commons-email makes sending multipart-emails much more easier.