Summary
This article describes the basics of creating a Java based email application. If you want to create your own email client application to replace Microsoft Outlook, or create a web-based email system to challenge Hotmail, you can start here. From a different point of view of JavaMail, this paper gives a conversation email client application.
In JavaMail, you can find the API and its implementation section to use it to develop full-featured email client applications. The email client application references the idea of Microsoft Outlook; However, you can write your own Outlook instead. However, an email client program does not necessarily reside on a client machine. In fact, it can be a servlet or EJB running on a remote server, and end users can send and receive their emails through a Web browser. In the author's own pet project, a voice client is used to read the incoming message. It is the author in "Talking Java!" The ideas introduced in the (there will be more introductions later) are refined.
Now start installing and configuring the JavaMail software.
Installation
If you are using the JAVA2 Enterprise version (Java) 1.3, then it has its own javamail, so there is no need for additional installation. But if you are using the JAVA2 Standard Version (J2SE) 1.1.7 and later versions, if you want your application to have the ability to send and receive emails, download and install the following two applications:
L, JavaMail
2. JavaBeans Activation Framework
The installation is very simple, just unzip the downloaded file and add the contained jar file to the classpath of your machine, the following is the classpath on the author's machine:
; C:appsjavajavamail-1.2mail.jar; C:appsjava
Javamail-1.2mailapi.jar; c:appsjavajavamail-1.2
Pop3.jar; C:appsjavajavamail-1.2smtp.jar; C:apps
Javajaf-1.0.1activation.jar
The Mailapi.jar file contains the core API classes, while the Pop3.jar and Smtp.jar files contain their respective implementation portions of the email protocol. (We don't use Imap.jar files in this article). The implementation section can be considered similar to a JDBC (Java database connection) driver, but it is used for message systems rather than for databases. As for the Mail.jar file, it contains each of the jar files above, so you can include only Mail.jar and Activation.jar files in your classpath.
The Activation.jar file allows you to handle MIME-type access in the form of binary data streams. In the back "not only can send normal text" This part will talk about the DataHandler class, you can find the relevant information there.
As for records, the remainder of this article does not fully explain the API, but you can learn to do it. If you want to learn more about API information, you can view the PDF files and Javadoc in each download package.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.