ApacheCon NA 2010 Session

Commons Email and Exec

You just wanted to send an email from within your application and got confused with BodyParts, MimeBodyParts, MimeMultiparts and friends of the Java Mail API?! If yes - have a look at commons-email to see how you can easily create text emails with attachments or HTML emails with embedded images in just a few lines of code. Using a simple "Runtime.exec()" in production code won't cut it and might break your application. Using commons-exec shields you from platform-specific exit codes, blocking error streams, run-away child processes, asynchronous process execution and cross-platform issues.