We have an existing Java web application that occasionally needs to send users an email with an image attachment. Right now, the J2EE web app is running on Tomcat in Windows, and we just have it exec() a process that runs the tiny little Blat program, like this:
As you can see, all I need to be able to do is send a little email with an image attachment. I don't even care if I can't BCC our log email address anymore. What would be the quickest/simplest/easiest solution to get the same functionality when we move this web app to Tomcat on Linux? From what I've read, sendmail might be a bigger deal than what I'm looking for. I'd love to be able to do it from within pure Java, but I don't know that I've run across any way to do it without getting into the whole JavaMail API...
It's an easy to use interface for the JavaMail package. It's also just out of the sandbox and unreleased...you'll probably have to pull it off the CVS and compile it yourself.
Anyway, I use it for html email with attachments and have had no problems.
Joined: Jul 15, 2003
Thanks for the post. I'm sure I might pick up that commons package at some point. I actually don't even need HTML in my emails. Anyway, right now this guy's code is good enough for sending binary attachments: