1

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.

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
Theo
  • 3,074
  • 7
  • 39
  • 54
  • 2
    "huge amount of emails"? I hope that you aren't talking about spam/newsletter without double-opt-in/similar stuff? – thejh Dec 12 '10 at 20:04
  • "is not very hard"... I do believe you are mistaken. Production mail servers are not easy to write. – Thorbjørn Ravn Andersen Dec 12 '10 at 20:17
  • There is a good chance your emails will end up in the spam-folder if you are going to sent out mass e-mails yourself. – Alfred Dec 12 '10 at 20:38
  • @thejh No, I'm not talking about spam/newsletter. I'm talking about emergency mass notification. @Thorbjørn Ravn Andersen: Sorry for not clearly stating this. I don't want to write my own mail server. I want to reuse existing mail servers using the JavaMail API. But the JavaMail API doesn't provide anything for concurrently sending and queing emails. @Alfred In my case, it is excluded that the emails will end up in spam, since the sender's address will be in the recipients address book. – Theo Dec 12 '10 at 21:10
  • What sort of emergency? Email isn't suitable for instant messaging. – reinierpost Feb 04 '13 at 09:07

4 Answers4

4

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.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
2

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).

Usman Saleem
  • 1,665
  • 9
  • 18
0

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

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
0

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

Charlie Martin
  • 110,348
  • 25
  • 193
  • 263