March 7, 2021
Hot Topics:

Making a POP3 Client

  • By Sam Huggill
  • Send Email »
  • More Articles »

The next thing we want to do is to download a list of the messages on the server. To do this we use the STAT command. In the sample code you will notice that I have used a User Defined Type structure and an array to store each message in. You may come up with another way that is better or more suited to your needs, but for the moment, I will just present the UDT:

Type tMailItem
  From As String
  Subject As String
  DateSent As String
  Bytes As Long
  Body As String
  Loaded As Boolean
  Deleted As Boolean
End Type

The names tell you quite basically what each one does. I would just like to point out that the last two properties, Loaded and Deleted play an important part in the sample project. The Loaded flag tells us if the message is currently loaded in the viewing window. The Deleted flag tells us if the message is to be deleted from the server when we disconnect. Any incorrect handling of the Deleted flag could cause serious problems in your application.

I hope that this article has given you enough understanding to be able to download the sample project (a fully functional POP client) and look through the code and know what's going on.

Download the code

Page 6 of 6

This article was originally published on November 20, 2002

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date