I am using JavaMail along with Postfix on an Ubuntu mail server. My desire is to send emails very rapidly for a newsletter with millions of recipients. So far, we are only able to get a performance of at most about 7 emails per second. I know there are several questions of this type on here already, so I've compiled some of the suggestions that I've found:
- Use multi-threading. With this, I have the concern of flooding Postfix with too many incoming messages. Does anyone have any experience with the scalability of this?
- Use
Transport.send(Message msg, Address[] addresses)
to send to multiple recipients at once. Does anyone know how this solution differs from just adding multiple recipients via BCC? Does it send to each address individually, or one message addressed to multiple recipients? - Use only one
Session
object for all messages. This one seems to make sense, and can probably be used along with points 1 and 2.
My overarching question is also whether I'm missing any points above, or if anyone has any experiences they can share with using JavaMail to build a bulk mail delivery system.