tags:

views:

62

answers:

3

I am building a web application that has to be able to do the following:

  • Send emails to the (external) addresses registered by the users (say, Gmail, Yahoo Mail, etc).
  • Send/receive emails to local mailboxes that live in the application. These are more "messages" in that sense.

What are the potential open source technologies I could integrate with here? Thanks for your inputs.

+2  A: 

So, you want a SMTP server? If you want to have it in Java, then I can suggest to pick Apache James. But in fact every decent SMTP server would suffice. You can just use JavaMail API, or the more convenienced Apache Commons Email which is built on top of JavaMail API, to talk with any SMTP server to send/read emails.

If you didn't already realize, you can also just make use of an existing SMTP server provided by your ISP or the web hosting. In this case only JavaMail or Commons Email would have been sufficient.

BalusC
+1  A: 

While Commons Email will help you get the sending part done, receiving email will require that you access mailboxes via IMAP or POP through the Java Mail API.

Java Mail is a little cumbersome to use, but this Stackoverflow question has a working IMAP sample to help you get started.

Henning
A: 

Thanks guys, much appreciated! One question though - while sending emails is rather straightforward, I am not looking into building the UI for the "receive mails" part. I would rather integrate with an existing service or technology that already does this. From an application standpoint, all that I want to be able to do is simply "plugin" to an existing architecture to leverage the sending and receiving of emails. Makes sense?

krish palaniappan