Creating an Email Client with Borland Delphi: conclusion - What is POP3?
(Page 2 of 4 )
POP3 stands for Post Office Protocol version 3 and is used to handle email between the email server and our local email client (such as Outlook or Eudora). POP3 is used to authenticate our credentials on the server and download email that comes from across the Internet to our email account. Use of the POP3 protocol is activated when we click on the "Receive" button in our email client. Until this happens our email will stay on the email server.

Indy10 has a component called idPOP3 that enables us to work with an email server (to receive messages) and mail client (to download messages from the email server). Take a look at the diagram above to understand what role POP3 plays in sending an email message.
Building the GUI
Now that we got that out of the way, let's get busy. Fire up Delphi and start a new application. Add two more forms to the project. We will use the first form to download and read our messages, the second to send messages, and the third to read messages with an option to reply. Remember, we are going to use the code from the first tutorial to send messages, so it will probably be wise to add that code into the second form around now, as I will NOT discuss sending messages in this tutorial.
Go to the Indy clients tab and select idpop3, add it to the first form, then go to the Indy Misc tab and select and add the idMessage component. Once you've added these two, rename idpop3 to pop and idmessage to mess. For those who are not familiar with Delphi, click on the component and then go to the object inspector (bottom left hand corner of screen) and change the name there. This speeds things up a bit when you start to write the code.
Indy Idpop3/idMessage Components:

IdPOP3 Component

IdMessage Component
Add two listviews, a memo, four panels, one status bar, four static text labels, four labels and four buttons. Rename Listview1 to lv1 and listview2 to lvAttachments. Now, click on lv1, go to vstyle, and change it to vsReport; do the same for lvAttachments. Double click on lv1 and add the following fields: From, Subject, Date and Size. Double click on lvAttachments and type "Attachment(s)". Arrange them on the form so that it looks something like this:

On the third form: drop three edit boxes, two buttons, a memo, four static text labels and one tlabel. Give the statictext the following captions: From, To, Subject and Date. Arrange to suit. It should look something like this:

The second form is the one that we will use to send messages with. Remember to use the code from the previous tutorial to build this form.
I've designed this (and indeed the entire application) to be as simplistic as possible, so feel free to add more widgets and colors to suit.
Next: Code >>
More Delphi-Kylix Articles
More By Jacques Noah