A mail server is a software that is installed on an actual physical server and provides e-mail services.
How it works: a user sends an e-mail via their computer to another user. The e-mail goes first to the mail server which is providing the mail services for user 1. From there the e-mail is sent to the server that provides the mail services for user 2 over the Internet. The second mail server serves the e-mail to user 2.
The mail server consists of agents that help with the distribution of the e-mails. Those agents are the Mail Submission Agent; the Mail Transfer Agent and the Mail Delivery Agent.
The Mail Submission Agent works closely with the mail client on the user's computer. The mail client is also referred to as Mail User Agent. E-mail clients are Mozilla Thunderbird, Microsoft Outlook and many others. These clients are applications installed on the user's computer and configured to connect with the MSA.
What the MSA does is to check the e-mail and make sure that everything is in order so that the transferring can proceed.
The MSA then sends the e-mail to the Mail Transfer Agent. This is the agent that is in charge of the receiving and sending e-mails from and to other MTAs.
After the Mail Transfer Agent receives the e-mail it then sends it to the Mail Delivery Agent, which sends the mail to the mailbox of the user. The mailbox is located on the server, and the user can access it via the e-mail client.
USER A>> MUA >> MTA>> MDA >> MUA >> USER B