You should use the JAVA Mail API for that. It's suitable.
Here are some Tutorials and helpful links:
Fundamentals on the JavaMail API
Was on oracle server, don't know why they do not host it any more. Great source.
All About Java Mail
] @ scribd.com
I can recommend to start with sending simple text messages, then to extend the SMTP to send HTML Messages, then add Attachments.
Please use a local Email Server for Development and Testing. HmailServer
] is free and runs on any Windows machine. Please be aware of the auto-ban option in that, disabling that in the settings can save a lot of nerves and time.
] is a simple Email client which you can use for development / testing. It's compact and this way you will have your normal emails completely separated from the development.