Well, into the main steps of this series of tutorials, the theoretical knowledge of the previous e-mail we all know, then this blog we will use the code to complete the delivery of the message. This is very widely used in real projects, such as registration needs to send mail for account activation, such as OA project using mail for task reminders and so on. What we're talking about here is the ability to use JavaMail to send and receive messages.PS:
the e-mail message. Since multipart is an abstract class, we must use a specific subclass for it, JavaMail The API provides the Javax.mail.Internet.MimeMultpart class to use the MimeMessage object.Usage:Mimemultipart multipart=new Mimemultipart ();Note: One way we use the Mimemultipart object is Addbodypart (), which adds the BodyPart (BodyPart class below) to our e-mail content. The message can have a lot
Part 2: About javamail
Document usage
The documentation in the downloaded javamail API is very useful. You can find it in/docs/javadocs/index.html under javamail. The second part mainly analyzes the mail program components. You can read the document for more information.
Javamail
so it can be encapsulated into a mailadaptor.jar.
Mailadaptor Introduction Mailadaptor is an adapter that is responsible for message access, message resolution, and message generation MIME.
2# Mailadaptor core function
javamail API provides javax. mail. internet. the mimemultpart class is used to use the mimemessage object.
Usage:Mimemultipart multipart = new mimemultipart ();
Note: One method of using the mimemultipart object is addbodypart (), which adds the bodypart (bodypart class will be introduced below) object in our email content. messages can have many parts. A bodypart can represent a part.
(9) javax. Mail. Int
Program
The JavaMail API is an optional package (standard extension) for reading, writing, and sending electronic messages that can be used to establish standards-based e-mail clients that configure various Internet mail messages, including SMTP, POP, IMAP, and MIME, as well as related NNTP, S/MIME and other agreements. It is often necessary to develop javamail
JS Part II: About JavaMail
Use of documents
The documentation that is available in the downloaded JavaMail API is useful. You can find it in the/docs/javadocs/index.html under the JavaMail. The second part mainly analyzes the components of the mail program. You can read the documentation to get more information on this
, however, you're running Java 2 platform, Standard Edition (j2se) 1.1.7 and upwards, and you want email capability for your applications, download and install the following:
Javamail
JavaBeans activation framework
To install, simply unzip the downloaded files and add the contained jar files to your classpath. As an example, here's my classpath for this project:
.;C:/Apps/Java/javamail-1.2/mail.jar;C:
RFC882 document will not be able to meet the requirements. The MIME protocol is an upgrade and supplement to the RFC822 document , which describes how to produce a complex message. Usually we refer to the MIME protocol as a MIME message . the data described by the MIME protocol is called a MIME message. For a complex message, if you have multiple different data, the MIME protocol specifies that you want to delimit multiple pieces of data using a separator, and use the Content-type header field
JS second part, about JavaMail
Working with Documents
After downloading the JavaMail API, the documents contained therein are very useful and the documents are stored in the subdirectory/docs/javadocs/of the directory where the JavaMail resides. The following describes some of the components that are required in the m
subclass for it, JavaMail The API provides the Javax.mail.Internet.MimeMultpart class to use the MimeMessage object.
Usage:
Mimemultipart multipart=new Mimemultipart ();
Note: One way we use the Mimemultipart object is Addbodypart (), which adds bodypart to our email content (BodyPart class is described below). Messages can have many parts, A bodypart can represent a part.
(9) Javax.mail.Internet.MimeB
subclass for it, JavaMail The API provides the Javax.mail.Internet.MimeMultpart class to use the MimeMessage object.
Usage:
Mimemultipart multipart=new Mimemultipart ();
Note: One way we use the Mimemultipart object is Addbodypart (), which adds bodypart to our email content (BodyPart class is described below). Messages can have many parts, A bodypart can represent a part.
(9) Javax.mail.Internet.MimeB
What is JavaMail?
JavaMail is a sun-released API for handling emails. It makes it easy to perform some common message transfers.
Although JavaMail is one of the Sun's APIs, it has not yet been added to the standard Java Development Toolkit (Java Development Kit), which means that you must download the
JS Part II: About JavaMail
Use of documents
The documentation that is available in the downloaded JavaMail API is useful. You can find it in the/docs/javadocs/index.html under the JavaMail. The second part mainly analyzes the components of the mail program. You can read the documentation to get more information on this
RFC822 document, which describes how to produce a complex message. Usually we call a MIME message the message described by the MIME protocol. The data described by the MIME protocol is called a MIME message.For a complex message, if you include multiple different data, the MIME protocol provides that you want to delimit multiple pieces of data using a separator line, and use the Content-type header field to describe the type of data and the relationship between multiple data.
Create and send m
How to Use the JavaMail program in android development, androidjavamail
JavaMail is a programming interface for developers to process emails. It is an API released by Sun to process emails. It can easily perform some common mail Transmission. We can develop applications similar to Microsoft outlook based on JavaMail.
1. Introduction:The development of Java Mail API is a good example of SUN's continuous efforts to provide a public API framework for Java developers. A public framework is promoted to oppose solutions restricted by suppliers, which fully predicts the establishment of an increasingly open development environment.The structure of the Java Mail API proves that t
upgrade and supplement to the RFC822 document , which describes how to produce a complex message. Usually we refer to the MIME protocol as a MIME message . the data described by the MIME protocol is called a MIME message. For a complex message, if you have multiple different data, the MIME protocol specifies that you want to delimit multiple pieces of data using a separator, and use the Content-type header field to describe the type of data and the relationships between multiple data.Iii. using
will not be able to meet the requirements. The MIME protocol is an upgrade and supplement to the RFC822 document , which describes how to produce a complex message. Usually we refer to the MIME protocol as a MIME message . the data described by the MIME protocol is called a MIME message. For a complex message, if you have multiple different data, the MIME protocol specifies that you want to delimit multiple pieces of data using a separator, and use the Content-type header field to describe the
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.