User Tools

Site Tools


Sidebar

Network and communication

k24:k24.5:k24.5.4:start

24.5.4 POP3 client

The project provides you with a POP3 client as a direct supplement to the SMTP client. The project uses properties and methods of the Pop3Client class (→ Chapter 24.4.1) as well as constants of the Net class and a self-developed parser for texts of the MimeMessage type (MMParser class). To manage email accounts, you can call up a manager (→ Chapter 24.3.4) in the menu.

B1
Figure 24.5.4.1: GUI POP3 client

The complete POP3 client project is provided in the download section.

24.5.4.1 Programme start

When the programme is started for the first time, a hidden directory is created in the user's home directory where a configuration file is saved by the integrated account manager or the POP3 client accesses the configuration file already created during work with the SMTP client. The POP3 client, the SMTP client and also the manager for e-mail accounts use the same configuration file.

Work with the manager for email accounts (basic data, SMTP and POP3 data) is omitted at this point and reference is made to chapters → 24.4.1.2 to 24.4.1.4.

The menu has the following structure:


Figures 24.5.4.1.1: POP3 Client Menu

24.5.4.2 Notes

If you have selected an e-mail account, an overview of all e-mails already stored in the account's mailbox and the contents of the first e-mail are displayed in the browser, provided at least one e-mail is available. The overview is sorted by date.

  • The date (complete date and time) displayed in the overview is the date on which the email was received from the POP3 server.
  • A click on a line in the grid (GridView) in the overview shows the content of the marked e-mail as well as existing attachments as symbols.
  • The attachments can be opened in suitable formats such as images, texts or archives with one click and saved in the dialogue with a click of the right mouse button.
  • Before downloading e-mails, the system checks whether there are new e-mails on the POP3 server that have not yet been saved in the local mailbox. Only then will a download be initiated.

For e-mails in text format, the message text is displayed in dark red:

B2
Figure 24.5.4.2.1: GUI POP3 client - text message

The text of e-mails in text format is converted to HTML. This has the advantage of being able to display all emails in the browser.

If Part.ContentType = "text/plain" Then
   sTextData = "<!DOCTYPE html>" & gb.NewLine
   sTEXTData &= "<html lang=\"de\">" & gb.NewLine
   sTextData &= " <head>" & gb.NewLine
   sTextData &= "  <meta charset=\"utf-8\">" & gb.NewLine
   sTextData &= "  <style>" & gb.NewLine
   sTextData &= "    body{font-family:\"Ubuntu mono\",Arial,Verdana,sans-serif;color:darkred; /
                     font-size:16px;}" & gb.NewLine
   sTextData &= "  </style>" & gb.NewLine
   sTextData &= " </head>" & gb.NewLine
   sTextData &= " <body>" & gb.NewLine
   sTextData &= Replace(Part.Data, gb.NewLine, "<br>\n")
   sTextData &= " </body>" & gb.NewLine
   sTextData &= "</html>"
   $bIsText = True
   File.Save($sBasePath &/ _TEXTFILENAME, sTextData)
Endif

For emails in HTML format, the layout as well as the design are specified by the email itself:

B3
Figure 24.5.4.2.2: GUI POP3 client - HTML message

The computer icons and in the status bar indicate whether the system is connected to the internet or not. The check only takes place at the start of the programme.

  • In the case of an e-mail of the mime type multipart/alternative, the text version is not displayed because the HTML version is given preference internally.
  • The WebView control used to display the content of an email only implements a rudimentary browser.
  • The most important messages when downloading e-mails are temporarily displayed in the status bar.
  • During the download of e-mails, you will see a coloured symbol on the right edge of the status bar as proof of an existing Internet connection between POP3 client and POP3 server. A text-based progress indicator exists on the left side of the status bar.

You can view the structure of each e-mail via the menu item 'Display e-mail structure'. This becomes important if you want to partially change or extend the POP3 client project. The structure of the displayed e-mail is shown in green in the browser:

STRUKTUR MIME-MESSAGE
----------------------

+ multipart/mixed
|
+-+ multipart/alternative 2
| |
| +-- text/plain 0
| |
| +-+ multipart/related 3
| | |
| | +-- text/html 0
| | |
| | +-- image/png bild1.png 0
| | |
| | +-- image/png bild2.png 0
|
+ Anhang 1: text/plain body.txt
+ Anhang 2: image/png chart.png
  • You can delete a marked e-mail via the menu item 'File > Delete e-mail' or with a click on the right mouse button in the dialogue. The deleted email is immediately removed from the display in the overview and also excluded from the display later. With a changed file extension (filename.old), however, the email remains stored in the mailbox of the email account used.
  • A reference to the POP3 client theory (Chapter 24.5.3) can be found in the menu item '?' .

Download

Project

Download

The website uses a temporary session cookie. This technically necessary cookie is deleted when the browser is closed. You can find information on cookies in our privacy policy.
k24/k24.5/k24.5.4/start.txt · Last modified: 16.08.2022 (external edit)

Page Tools