Java developers the basic knowledge of aspects of e-mail

Often to send us information on the use of social networking in the mail. If we need the message "automatic" issue: for example, retrieve the password when the password will be sent to your secure mailbox, such as games pay when activated, it will be in the form of a mailbox send you an activation code to activate; another example, when your credit card when you bind service mailbox will receive a bill reminder messages. So, automatically send and receive mail messages, it is a software system functions can not be obtained, then we have to learn how to use Java to develop e-mail systems. What we want to learn is very simple, there are only two:


First, some basic knowledge of e-mail

1. mail server
on the Internet, to provide e-mail function, it must have a dedicated e-mail server. Provide common mail server site 163/126 / Sina, these are the public face of the free e-mail server, there are many companies offer a mail server for within the company.

Send and receive e-mail are relying on our mail servers come. Send and receive e-mail and send a letter reality, like the return to the local post office to the new A, the local post office by the carriage of the letters sent to the place where the recipient, received by the addressee's post office location B, then by the postman to the recipient, and this is actually the same as we send e-mail, first sent by the sender's mail servers 163, 126 if the recipient mail server, mail server 163 then sends the mail to the mail server 126, then 126 after the server receives e-mail give recipients.

E-mail provides the following functions:

  1. Accept user on delivery
  2. User forwards incoming mail delivered to the target mail server
  3. Other mail server receives the message and forwards the message to the user to store the message in its management
  4. Provide reading services for the customers to come to read mail

Mail server can be divided into two types:

  1. SMTP server: SMTP server for sending and receiving e-mail sent out to local users for users, which is equivalent to the mail receiving department of our real-life post office (can receive regular user to be cast out of the post office mail and other incoming mail delivery ).
  2. POP3 / IMAP server: POP3 / IMAP mail servers to help users to read the user's mail server receives incoming SMIP, which is equivalent department specializes in providing services for the customers to come to take the parcel.

2. E-mail
on each mail server can set up multiple e-mail, e-mail, also known as Email address, which is similar to real-life communication address, the user can accept others sent by e-mail and via this address send e-mail to others. Access to electronic mail application needs to be on the mail server, specifically, e-mail application is actually a user account on the mail server. Mail server to save the received messages to an account for the allocation of space in the mailbox, the user through the application of user name and password to log on to check e-mail address has been received on the mail server.

3. The mail client software
mail client software to communicate with the mail server is responsible, mainly to help users send mail to SMTP server reads the user from the POP3 / IMAP mail server e-mail. Mail client software is usually set compose, send and receive functions in one.

4. Mail Transfer Protocol
agreement into SMTP and POP3 / IMAP protocols, the former is a protocol for transmitting and receiving e-mail, which is a protocol for reading messages in SMTP server.

The e-mail transmission process

The figure is a user on the mail server to address Sina Sohu user mail server process.
----------------
Disclaimer: This article is the original article CSDN bloggers "Kong Chai December", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source and link this statement.
Original link: https: //blog.csdn.net/acmman/article/details/69431969

Published 694 original articles · won praise 560 · Views 1.34 million +

Guess you like

Origin blog.csdn.net/qq_36761831/article/details/104451194