Once you install JavaMail, there is an example called SimpleClient in the folder %JAVAMAIL_HOME%/demo/client
I think that example should have all you need.
See the file %JAVAMAIL_HOME%/demo/client/README.txt to get to know about compiling the example and what the example contains.
NOTE: This is taken virtually verbatim from the sendfile.java example included with the JavaMail API.
All credit for the code belongs to Christopher Cotton and Sun Microsystems!
That said...
Assuming you've already created a MimeMessage object named msg and a String filename (and set recipient, subject, etc...):
MimeBodyPart mbp1 = new MimeBodyPart();
mbp1.setText("Here's your attached file!");
MimeBodyPart mbp2 = new MimeBodyPart();
FileDataSource fds = new FileDataSource(filename);
mbp2.setDataHandler(new DataHandler(fds));
mbp2.setFileName(fds.getName());
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);
mp.addBodyPart(mbp2);
msg.setContent(mp);
...
NOTE: This is taken virtually verbatim from the sendfile.java example included with the JavaMail API.
All credit for the code belongs to Christopher Cotton and Sun Microsystems!