from which it can be processed and saved (you can also save the main mail text with
the Save button in the View window itself). The main part is included, because not all
mails have a text part. For messages that have only HTML for their main text part,
PyMailGUI displays plain text extracted from its HTML text in its own window, and
opens a web browser to view the mail with its HTML formatting. Again, I’ll say more
on HTML-only mails later.
Figure 14-22. Main text part opened in PyEdit
Besides images and plain text, PyMailGUI also opens HTML and XML attachments in
a web browser and uses the Windows Registry to open well-known Windows docu-
ment types. For example, .doc and .docx, .xls and .xlsx, and .pdf files usually open,
respectively, in Word, Excel, and Adobe Reader. Figure 14-23 captures the response
to the lp4e-pref.html quick-access part button in Figure 14-18 on my Windows laptop.
If you inspect this screenshot closely, or run live for a better look, you’ll notice that the
HTML attachment is displayed in both a web browser and a PyEdit window; the latter
can be disabled in mailconfig, but is on by default to give an indication of the HTML’s
encoding.
The quick-access buttons in the middle of the Figure 14-18 view window are a more
direct way to open parts than Split—you don’t need to select a save directory, and you
can open just the part you want to view. The Split button, though, allows all parts to
be opened in a single step, allows you to choose where to save parts, and supports an
arbitrary number of parts. Files that cannot be opened automatically because of their
type can be inspected in the local save directory, after both Split and quick-access but-
ton selections (pop up dialogs name the directory to use for this).
After a fixed maximum number of parts, the quick-access row ends with a button
labeled “...”, which simply runs Split to save and open additional parts when selected.
Figure 14-24 captures one such message in the GUI; this message is available in
SavedMail file version30-4E if you want to view it offline—a relatively complex mail,
with 11 total parts of mixed types.
1040 | Chapter 14: The PyMailGUI Client