Implementing an SMTP server in Java

Source: Internet
Author: User
Tags imap mail client

Child mail delivery can be implemented by a variety of protocols. Currently, the three most popular e-mail protocols on the Internet are SMTP, POP3, and IMAP, which are described briefly below.

SMTP protocol

The Simple Mail Transfer Protocol (SIMPLEMAILTRANSFERPROTOCOL,SMTP) is a protocol that runs on top of TCP/IP and uses it to send and receive e-mail messages. The SMTP server listens on the default port 25. The SMTP client communicates with the SMTP server using a simple set of text-based commands. After a connection has been established, in order to receive the response, the SMTP client first issues a command to identify their e-mail address. If the SMTP server accepts a text command from the sender, it uses an OK response and an integer code to confirm each command. Another command sent by the customer means the beginning of the body of the e-mail message, and the body of the message is a dot. Plus carriage return terminated.

POP3 protocol

The Post Office Protocol (POSTOFFICEPROTOCOLVERSION3,POP3) provides a standard mechanism for queuing mail messages so that recipients can retrieve messages later. The POP3 server is also running on top of TCP/IP and is listening on the default port 110. After an initial session between the client and the server, a text-based command sequence can be exchanged. POP3 customers use user name and password to authenticate to POP3 server. Authentication in POP3 is done on the basis of an unencrypted session. POP3 the customer sends a series of commands to the POP3 server, such as requesting the status of the client's mailbox queue, requesting the contents of the mailbox queues listed, and requesting that the actual message be retrieved. POP3 represents a message delivery service that stores forwarding types. Most mail servers now send mail using SMTP and receive e-mail messages using POP3.

IMAP protocol

The Internet Message Access Protocol (INTERNETMESSAGEACCESSPROTOCOL,IMAP) is an e-mail Message Queuing service that provides important improvements to POP3 storage and forwarding restrictions. IMAP also runs on TCP/IP using the syntax based on text commands, and IMAP servers typically listen on the default port 143. The IMAP server allows IMAP customers to download the header of an e-mail message and does not require the entire message to be downloaded from the server to the customer, as is the POP3. An IMAP server provides a queuing mechanism to receive messages, and must be combined with SMTP to send messages.



Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.