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.
Figure 24.5.4.1: GUI POP3 client
The complete POP3 client project is provided in the download section.
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:
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.
For e-mails in text format, the message text is displayed in dark red:
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:
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.
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
Project