In the process of sending an e-mail, e-mail client works together with the SMTP server to handle the sending. The SMTP server on local host may have communications with other SMTP servers to send the e-mail.
Let's consider, to send an e-mail from e-mail ID is admin and this account is on asp-mssql.com to webmaster@gmail.com.
From Outlook Express, as email client, one has to specify the name of the mail server -- mail.asp-mssql.com, after sending composed a message, following things happen with mail:
1. Outlook Express, email client first connects to the local SMTP server at mail.asp-mssql.com on port 25 (default).
2. Outlook Express has a communication with the SMTP server, informing the SMTP server about the sender address and the receipt address, along with the body of the message.
3. The SMTP server takes the "TO" address (webmaster@gmail.com) and puts it into two parts: webmaster (the recipient name) and the gmail.com (domain name). If the "TO" address belongs to another user at asp-mssql.com, the SMTP server would forward the message to the POP3 server for asp-mssql.com using the delivery agent. As the recipient is at another domain, SMTP needs to communicate with gmail.com.
4. The SMTP server has a communication with a Domain Name Server. It asks for, the IP address of the SMTP server for gmail.com. The DNS provides one or more IP addresses for the SMTP server(s) for gmail.com.
5. The SMTP server at asp-mssql.com connects with the SMTP server at gmail.com on port 25. It provides same simple text conversation that received from e-mail client, and provides the message to the gmail.com server. The gmail.com server identifies the domain name for webmaster, so it hands the message to gmail's POP3 server, which delivers the message in mailbox of webmaster.
If the SMTP server of asp-mssql.com fails to connect the SMTP server at gmail.com, then the message remains into a queue. Message is occasionally tried to resend in its queue.After specified period of time, if it fails to delivered, it sends undelivered report.
Following are the commands like HELO, MAIL, RCPT and DATA.
* HELO - introduce yourself
* EHLO - introduce yourself and request extended mode
* MAIL FROM: - specify the sender
* RCPT TO: - specify the recipient
* DATA - specify the body of the message (To, From and Subject in the first three lines.)
* RSET - reset
* QUIT - quit the session
* HELP - get help on commands
* VRFY - verify an address
* EXPN - expand an address
* VERB - verbose