The SMTP-Client project provides you with a fully-fledged SMTP client. Almost all properties and methods of the class SmtpClient as well as the most important constants of the Net class are used. To manage e-mail accounts, you can call up a manager (→ Chapter 24.3.4) in the menu.
Figure 24.4.1.1: GUI SMTP client
The complete project is provided in the download area. We will therefore not present the source code. The introduction to working with the SMTP client and the manager for e-mail accounts is more comprehensive. Numerous illustrations support the description.
When the programme is started for the first time, a hidden directory is created in the user's home directory where the configuration file is saved. The SMTP client as well as the manager access this configuration file. You will be informed that no e-mail account exists yet:
Then a dialogue window of the Manager for EMail Accounts is started. You can enter the basic data for the e-mail account:
Figure 24.4.1.2.1: Dialogue for basic data
OK' saves the data entered in the form in the newly created configuration file in the existing hidden directory. The name is optional. It is the name that the reader of an email reads in the line containing the email address of the sender of the email. When the window is closed, the manager starts.
Figure 24.4.1.3.1: Account manager
With the manager you can
In order to work with the SMTP client, further (SMTP) details are required in addition to the basic data. A click on the SMTP entry for the edited account in the treeview opens another dialogue window:
Figure 24.4.1.4.1: SMTP dialogue box
Some default values are already selected - all others have to be entered according to the specifications of your provider. Attention: For Freenet and T-Online the user name is the complete e-mail address. Press 'OK' to close the dialogue and return to the manager:
Figure 24.4.1.4.2: Account Manager
You could now close the manager and thus start the SMTP client for the first time.
However, it is recommended that you also complete the account data with the POP3 details so that they are also available to a POP3 client later:
Figure 24.4.1.4.3: POP3 Dialogue
You can only select the authentication option 'Password encrypted (APOP)' in the figure on the right if you are sure that the POP3 server also offers this method of authentication - for example, the POP3 server of Freenet.
With 'OK' this dialogue is also closed and you return to the manager:
Figure 24.4.1.4.4: Account Manager
The details of the first account are now complete and 2 more accounts are added here:
Figure 24.4.1.4.5: Account manager with 3 email accounts.
You can fold or unfold the display in the TreeView with the two buttons below the account overview if you have more than one account.
Closing the manager opens the SMTP client with the currently edited email account. Therefore, the sender email address is already entered:
Figure 24.4.1.5.1: SMTP client
Now you can make all relevant entries and optionally add attachments. You can delete individual attachments via the context menu in the list. You can enter several e-mail addresses (To:, Copy (CC): or Blind Copy (BCC):) as a list - with a comma as separator.
Before sending, the mandatory entries are checked:
When you send the email, the email is transferred to the SMTP server (MTA) for forwarding.
A progress symbol in front of the button 'Send EMail' informs about the sending process.
If no error occurred, you will receive a success message:
Project