I am trying to send an email with attachments and found the java mail api to be irritatingly insufficient.
There are only two implementations of javax.activation.DataHandler which mandates me to create a local file to send an attachment. May be I have to write my own implementation of DataHandler but I dont want to do that at this point.
thanks in advance !
Addy
EDIT : I meant javax.activation.DataSource not javax.activation.DataHandler
Spring provides a
partial wrapper around the JavaMail API, making it a bit easier to swallow.For example, the
MimeMessageHelperclass allows you to add attachments using various interfaces, including from a generalInputStreamsource.The underlying mechanics of JavaMail are very comprehensive and robust, it’s just the API that’s rubbish. This addresses that concern, to a large degree.