JavaMail, MIME, Attachments etc

Hi, I hope somebody can help me on this one as I seem to be going round in circles!

I am trying to create an agent that sends mail directly to an SMTP server. So far, using code from Jake@Codestore, I have got as far as sending an HTML mail in java - no problems there. My code picks up text from an HTML file on the hard drive and a field on a notes document.

Where I am getting stuck is attachments. The agent I currenly use just sends the html strings direct to SMTP, it does not use MIME objects. I think to attach files I need to create my email using the JavaMail classes, so I have downloaded the API and I am toying with some sample code I found on the internet, but being a bit of a java novice I am not getting very far.

Basically, I would like to create a MIME message, one part as text/html (with the body of my email) and the other(s) as the correct mime type attached to the document I am currently processing.

Can anyone point me in the direction of a tutorial on this - or maybe give me some guidance? I’d be very very grateful.

Many Thanks

Ben