Java framework for sending emails

4.8k Views Asked by At

Do you know any framework in Java for reliably sending a huge amount of emails with the following features:

  • Send and receive emails
  • Concurrently process emails from a queue to maximize the throughput
  • Keep track of emails that could not be delivered

I know that writing my own is not very hard, but I was wondering whether there is already something sophisticated that I can reuse.

UPDATE: The use case for my question is not sending newsletters or spam. It's emergency mass notification, e.g. sending 50,000 emails within 5 minutes. I also do not want to implement my own mail server, I want to use existing mail server(s) with the JavaMail API. But the JavaMail API doesn't provide any facilities for queing and concurrently sending emails and keeping track of emails that could not be sent.

4

There are 4 best solutions below

0
On

Try the Java Mail API. But for really bulk mailing you probably want to talk directly to SMTP.

0
On

You use the Java Mail API to construct the actual messages you want to send, and let JavaMail use a production quality mail server to do the actual delivery.

An easy configuration to get up and running is postfix under Ubuntu Server.

Please, please, please do not send out unsolicited spam.

0
On

Send and receive emails? Perhaps you are looking for mailing list manager in Java? Take a look at Subetha which is successfully used in several production sites (and written in Java). http://code.google.com/p/subetha/

They have a sub module, called Subethasmtp, which you can use as a smtp server (in Java).

0
On

You can use "JavaMail" or "GreenMail" for sending and receiving email