This section section describes the Simple Mail Transfer Protocol (SMTP) and its implementation on Symbian platform.
SMTP is the most widely used protocol for sending emails. It is a text-based and push protocol that cannot pull messages from a remote server on demand.
One or more recipients of a message are specified in a message along with the message text and other encoded objects. The message is then transferred to a remote server using a procedure of queries and responses between the client and server. Either an end-user's email client (Mail User Agent (MUA)) or a relaying server's Mail Transport Agents (MTA) can act as an SMTP client. The SMTP client initiates a TCP connection to SMTP server on port 25 (unless overridden by configuration).
SMTP is more suitable for a machine permanently connected to the Internet. To retrieve messages only on demand, which is the most common requirement on a single-user computer, a mail client must use POP3 or IMAP4. POP3 is mostly preferred when single-user computers connected to the Internet only intermittently.
SMTP is a Mail Transfer Agent (MTA) used to transfer emails to a SMTP server which then forwards them on to a specified destination.
Sending an email generally consists of three phases: connect and authorise to server, send emails and quit.
The SMTP component is responsible for sending email messages composed and stored in the Message Server’s Message Store.
The SMTP client initiates a connection with the SMTP server. Depending on the user’s email settings, this may have been initiated over a secure SSL/TLS socket on port 465.
Depending on how the user has configured the email settings and the capabilities of the SMTP server, SMTP authentication may also be required.
Mail From and recipient To are sent.
The message header fields for the email message stored in the Message Store are then transmitted, each one separated by a CRLF.
The last CRLF is sent to indicate the end of the RFC 2822 header.
The message body and encoded attachments are sent.
The encoding format (uuencode or MIME, character sets) depends on the user’s email settings and locale.
Finally, the body is terminated by a CRLF.
CRLF sequence, and the email is queued by the SMTP server for sending.
For more details on implementing the IMAP4 MTM functions, see POP/IMAP Example.