Send a simple SMTP email message with java

The next code will show you the simplest way to send an email in java. The only thing you need is an email address and the smtp host address of your email supplier. This code can only send a simple formatted text, without HTML or attachments. In the future I will show how to do those as well. You will also need the mail.jar that can be found here. Unless you are using Java 6 you will also need the activation.jar which can be found here. download source