This might be a little too old, but I just managed to get javamail and sendmail to work together. It's actually super easy and I felt stupid for not getting it done faster...
Let's ignore sendmail for a bit here. How can we send an e-mail through javamail? There are tons of tutorials online, but here's how it's done:
- Create your session with the appropriate authenticator;
- Create your MimeMessage object (here's where you add all your recipient addresses);
- Call Transport.send() with your message.
What if your SMTP server only sends emails up to 100 recipients (like mine)? That's when sendmail comes into play. You can think about sendmail as your own SMTP server. So install it first. If you're running Ubuntu (like me), just do:
sudo apt-get install sendmail
The installation ends pretty quickly. After that, sendmail is ready to be used. I didn't bother configuring any type of authentication or whatsoever, but it's probably a good idea to do so if your server will have a public IP on the internet. Now, instead of pointing your java code (that uses javamail) to your SMTP server, just point it to localhost (or whatever machine you just installed sendmail).
You can even test your sendmail installation with your regular mail client (thunderbird, outlook, windows mail or whatever floats your boat). Just configure your SMTP server to the machine you installed sendmail. Guess what? It works!
Just don't use this to send emails to the entire world... ;)