Email protocol governs the interactions between email clients and servers. An Email protocol is a standard method which is used at each end of a communication channel either server side or client side, in order to transmit information properly. User is required to use a mail client to access to the mail server, by using variety of email protocols, the mail client and server can only exchange their information with each other. Three examples of Email protocol are:
Simple Mail Transfer Protocol (SMTP) transmits electronic mail (email) within different hosts in the Department of Defense Internet protocol suite. Email servers and other mail transfer agents use SMTP to send and receive messages, while SMTP usually used by client side’s email application to send messages to the email server for relaying only. For receiving messages, client side would mostly use POP protocol which will be introduced at the next part. Examples of email client that used SMTP to send messages are webmail systems: Hotmail, Gmail and also Outlook, Microsoft Exchange and so on. SMTP listens on TCP protocol well-known port 25.
Functions of SMTP:
To enable the client side to send email message to a receiver (an email address which already exist), SMTP would perform the following functions:
Advantages of SMTP:
SMTP is the simplest way to send an electronic mail between various computers in a particular network. As long as there is a receiver destination and a sender who send the message, the message will be send to the destination. The message will pass through a simple process from SMTP server to an exchange server for the receiver’s computer.
As we known SMTP is the simplest way to transmit a message, email messages can be sent quickly and easily by using SMTP. As long as the condition of the mail server is good, the messages that are sent will reach to the recipients as quick as possible.
When the message has failed to deliver, an error message will be sent to inform the sender and the message that failed to deliver will be sent back to the sender. In this case, sender doesn’t have to worry that the message send will failed to delivered, because when the message is failed to delivered, sender can choose to resend the message until the message is finally delivered to the recipient successfully.
Limitation of SMTP:
Original SMTP identifies clients by using the IP addresses, but it is only available when the email services are provided by the same Internet server provider that supplied the connection. Therefore, an extension named” SMTP-AUTH” is required to verify the senders of the messages.
Post Office Protocol (POP) is a Internet standard protocol in the application layer which allows email clients to retrieve email messages from a remote mail server. Out of the versions of POP that has been developed, current standard which used in most of the client and server email communication architecture is version 3 of POP also written as POP3. POP3 server listens on TCP protocol well-known port 110. It uses the TCP/IP protocol stack for network connection and works with SMTP for end-to-end email communication. In this case, POP is responsible to “pull” the messages from the server and SMTP will “push” the messages to the server.
Function of POP:
Advantages of POP:
Disadvantages of POP:
MIME is an extension which allows users to use the protocol to send different kinds of data files on the Internet, for example: audio file, image file (PNG, GIF, JPEG), video or even application programs. SMTP protocol only handled ASCII text, which means, only ASCII texts can be send through the protocol. Media type of content in email is described by MIME type, some of the examples for MIME types are:
Advantages of MIME:
Old version of Internet email standard allows only ASCII characters messages, messages not exceed 1000 characters and so on. But with MIME, it allows additional fields for mail message by using the MIME headers that describe new types of content and organization for messages.
MIME allows mail messages to consist of the following:
Disadvantages of MIME:
Diagrams below show how client and server send and retrieve messages via SMTP and POP protocols, also how the multipurpose internet mail extension works:
How to apply the following email protocols (SMTP, POP, MIME) with ASP.NET?
One way to apply the mentioned email protocols with asp.net is using System.Net namespaces. It consists of classes that provide simple programming interface for several number of network protocols, compose Email and send it, it also consist of representation of multipurpose internet mail exchange (MIME) headers. Besides, it also can access to network traffic data and peer-to-peer networking function.
SMTP
Inside System.Net, there is a namespace called System.Net.Mail, it contains classes that we needed which is to send email messages to a simple mail transfer protocol (SMTP) server for it to be delivered. Classes include in this namespaces are for example: an Attachment class which allowed user to add an attachment into the email, MailMessage class represents the email message that can be sent by using the SmtpClient class, while there is also a class which allowed user to send an email by using the SMTP.
List of all the classes in System.Net.Mail namespace will be included in Appendix A.
To actually send an email using SMTP, we will require these following items:
Once we have accessible SMTP server, it is time to send our email message! Firstly we will need to create an empty page which consists of the example coding shown:
Next we can choose to send the email to more than one person at a time, by adding email address to the “To” collection as shown below:
After that we can set the name of the sender, this will be shown along with the sender email address to the recipient once the email has been received. For instance, we can do this:
Next, we can use the CC and BCC fields in the email messages, for example:
Other than that, we can also set priority of an email message, by using one of the method provided in the System.Net.Mail class:
POP
To log in to a POP server, we need to use System.Net.Sockets namespace. Classes that we can use from the System.Net.Sockets namespace are for example TcpClient and NetworkStream.
Firstly, we will need a simple aspx page which consists of several textfields that allow user to enter the username and password.
To initiate the connection to POP3 server, we will use the System.Net.Sockets. For example, after user enter their username and password, and then there is a on click event of the button as shown in the following header:
Next, we will send the username and password to the server, and the server response will be displayed:
If the username and password are valid and successfully verified by the POP server, we will get a response and then start to retrieve a list of messages from the server. We will request for using the LIST command and display each message that we loop through:
At last, we need to close the connection to the server. In this case, QUIT command has come to use, and then server response will be display:
MIME
Similar with implementing SMTP into asp.net, we can use the classes within System.Net.Mail namespace to apply MIME into asp.net. There is one namespace called System.Net.Mime which holds the types that used to represent MIME headers. These types are use along with the types in System.Net.Mail namespace when a SmtpClient class send an email with attachment. Data of MIME is represented by Attachment class which we just mentioned in the System.Net.Mail part. Here are some example of classes included in the System.Net.Mime:
Class |
Description |
ContentType |
This represents a Content Type header in MIME protocol. |
MedisTypeNames |
Media type information for the attachment included in an email message. |
MediaTypeNames.Image |
This will specifies the type of image file attached into an email message, for example, .png, .jpeg and so on. |
For the full list of classes included in System.Net.Mime, please refer to Appendix B.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more