Introducing the JavaMail API

As you have seen, email systems have relatively complex architectures and use a selection of transport protocols. In the past, if you wanted to send or retrieve email messages you would have used TCP sockets with an appropriate protocol to talk directly to an email server. Alternatively, you could have used a vendor-specific API to access email functionality, locking your code into one platform or one technology. The JavaMail API changes all of this.

The JavaMail API provides a generic model of an email system, which allows you to send and retrieve messages in both a platform- and protocol-independent way. In addition, JavaMail allows you to easily create different types of messages, such as plain text, those with ...

Get Sams Teach Yourself J2EE™ in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.