• Complain

Elliotte Rusty Harold - JavaMail API

Here you can read online Elliotte Rusty Harold - JavaMail API full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2013, publisher: OReilly Media, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Elliotte Rusty Harold JavaMail API

JavaMail API: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "JavaMail API" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Send and receive email from Java applications by using the JavaMail API. With this concise book, youll learn how to communicate with existing SMTP, POP, and IMAP servers, and how to write your own.

Whether you need to build an email-centric application like a mailing list manager or simply add email notification to a larger product, JavaMail is the answer. Packed with code examples, this book shows you how JavaMail enables you to avoid low-level protocol details, so you can focus on what you actually want to say in a message.

  • Send, receive, and store email with POP3 and IMAP
  • Add password authentication to your programs
  • Manage mailboxes and accounts
  • Download mail attachments
  • Respond to asynchronous email events
  • Design protocol-independent email programs

Elliotte Rusty Harold: author's other books


Who wrote JavaMail API? Find out the surname, the name of the author of the book and a list of all author's works by series.

JavaMail API — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "JavaMail API" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
About the Author

Elliotte Rusty Harold is originally from New Orleans to which he returns periodically in search of a decent bowl of gumbo. However, he currently resides in the Prospect Heights neighborhood of Brooklyn with his wife Beth, dog Shayna, and cat Marjorie (named after his mother-in-law). He's a frequent speaker at industry conferences including Software Development, Dr. Dobb's Architecure & Design World, SD Best Practices, Extreme Markup Languages, and too many user groups to count. His open source projects include the XOM Library for processing XML with Java and the Amateur media player.

Chapter 1. Introducing the JavaMail API

The JavaMail API is a fairly high-level representation of the basic components of any email system. The components are represented by abstract classes in the javax.mail package. For instance, the abstract class javax.mail.Message represents an email message. It declares abstract methods to get and set various kinds of envelope information for the message, such as the sender and addressee, the date sent, and the subject. The abstract class javax.mail.Folder represents a message container. It declares abstract methods to retrieve messages from a folder, move messages between folders, and delete messages from a folder.

These classes are all abstract because they dont make many assumptions about how the email is stored or transferred between machines. For instance, they do not assume that messages are sent using SMTP or that theyre structured as specified in RFC 822. Concrete subclasses of these classes specialize the abstract classes to particular protocols and mail formats. If you want to work with standard Internet email, you might use javax.mail.MimeMessage instead of javax.mail.Message, javax.mail.InternetAddress instead of javax.mail.Address, and com.sun.mail.imap.IMAPStore instead of javax.mail.Store. If you were writing code for a Microsoft Exchange-based system, youd use different concrete implementation classes but the same abstract base classes.

The JavaMail API roughly follows the abstract factory design pattern. This pattern allows you to write your code based on the abstract superclasses without worrying too much about the lower-level details. The protocols and formats used and the associated concrete implementation classes are determined mostly by one line of code early in the program that names the protocol. Changing the protocol name goes 90% of the way toward porting your program from one protocol (say, POP) to another (say, IMAP).

Service providers implement particular protocols. A service provider is a group of concrete subclasses of the abstract JavaMail API classes that specialize the general API to a particular protocol and mail format. These subclasses are probably (though not necessarily) organized into one package. Some of these (IMAP, SMTP) are provided with the reference implementation in the undocumented com.sun.mail package. Others (NNTP, Exchange) are available from third parties. And some (POP) are available from both Oracle and third parties. The purpose of the abstract JavaMail API is to shield you from low-level details like this. You dont write code to access an IMAP server or a POP server; you write code that speaks to the JavaMail API. Then the JavaMail API uses the service provider to speak to the server using its native protocol. This is middleware for email. All you need to do to add a new protocol is install the service providers JAR file. Simple, carefully designed programs that use only the core features of the JavaMail API may be able to use the new provider without even being recompiled. Of course, programs that make use of special features of individual protocols may need to be rewritten.

Since mail arrives from the network at unpredictable times, the JavaMail API relies on an event-based callback mechanism to handle incoming mail. This is exactly the same pattern (even using some of the same classes) found in the Swing and JavaBeans. The javax.mail.event package defines about half a dozen different kinds of mail events, as well as the associated listener interfaces and adapter classes for these events.

While many people still fondly recall the early days of ASCII email and even ASCII pictures, modern email messages contain a bewildering array of multilingual text and multimedia data encoded in formats such as Base64, quoted-printable, BinHex, and uuencode. To handle this, the JavaMail API uses the JavaBeans Activation Framework (JAF) to describe and display this content.

This book covers Version 1.5 of the JavaMail API. The JavaMail API is a standard extension to Java, not part of the core JDK or JRE class library, even in Java 8. (It is a standard part of Java Enterprise Edition (JEE)). Consequently, youll need to download it separately from Oracle and install it on your system. Its freely available from Java. It comes as a JAR archive named javax.mail.jar . This file contains the actual .class files that implement the JavaMail API. To compile or run the examples in this book, youll need to add this file to your class path, either by adding its path to the CLASSPATH environment variable or by placing javax.mail.jar in your jre/lib/ext directory.

If youre using Java 5, you will also need to install the JavaBeans Activation Framework. (Its bundled with the JDK starting in Java 6.) You can download it from Oracles website. This download contains the activation.jar archive, which youll also need to place in your class path.

Finally, you may want to add some additional providers. Oracles implementation includes POP3, SMTP, Gmail, and IMAP providers. However, third parties have written providers for other protocols such as Hotmail, NNTP, Exchange, and more. lists some of these.

Table 1-1. Mail providers
Product (company)URLProtocolsLicense

JavaMail (Oracle)

http://www.oracle.com/technetwork/java/javamail

SMTP, IMAP, POP3, Gmail

GPL with Classpath Exception

J-Integra Exchange: (Intrinsyc Software)

http://j-integra.intrinsyc.com/exchange.asp

Microsoft Exchange (DCOM)

Payware

exJello: (Eric Glass)

http://www.exjello.org/

Microsoft Exchange (WebDAV)

MIT License

ICE MH JavaMail Provider (ICE Engineering, Inc.)

http://www.trustice.com/java/icemh

MH

Public domain

POPpers (Y. Miyadate)

http://www2s.biglobe.ne.jp/~dat/java/project/poppers/index_en.html

POP3

GPL

JDAVMail (Luc Claes)

http://jdavmail.sourceforge.net

Hotmail (WebDAV)

LGPL

GNU JavaMail (FSF)

http://www.gnu.org/software/classpathx/javamail/

POP3, NNTP, SMTP, IMAP, mbox, maildir

GPL with library exception

mbox Store (Oracle)

https://java.net/projects/javamail/pages/MboxStore

mbox

Chapter 2. Sending Email

Sending messages is the most basic email need of a Java program. While email clients like Thunderbird and mailing list managers like listproc are the only common programs that receive messages, all sorts of programs send messages. For instance, web browsers can submit HTML forms via email. Security scanning tools can run in the background and email their results to the administrator when theyre done. When the Unix cron program detects a misconfigured

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «JavaMail API»

Look at similar books to JavaMail API. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «JavaMail API»

Discussion, reviews of the book JavaMail API and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.