A mail server (sometimes called an email server) is a software program that sends and receives email. Often, it is used as a blanket term for both mail transfer agents (MTA) and mail delivery agents (MDA), each of which perform a slightly different function.
Mail servers play a crucial role in the email delivery process. Without them, users would have no way of transferring those messages to and from other mail clients.