Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
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.
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:
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
Pop3.jar; C:appsjavajavamail-1.2smtp.jar; C:apps
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.
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.