The JavaMail API provides classes that model a mail system.