[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版

(yzsuai) #1

Cc prefill of original recipients done by Reply isn’t performed for forwards, because
they are not a continuation of group discussions.


Notice that I’m forwarding this message to three different addresses (two in the To,
and one manually entered in the Bcc). I’m also using full “name

” formats
for email addresses. Multiple recipient addresses are separated with a comma (,) in the
To, Cc, and Bcc header fields, and PyMailGUI is happy to use the full address form
anywhere you type an address, including your own in mailconfig. As demonstrated by
the first To recipient in Figure 14-30, commas in address names don’t clash with those
that separate recipients, because address lines are parsed fully in this version. When
we’re ready, the Send button in this window fires the forwarded message off to all
addresses listed in these headers, after removing any duplicates to avoid sending the
same recipient the same mail more than once.


I’ve now written a new message, replied to it, and forwarded it. The reply and forward
were sent to my email address, too; if we press the main window’s Load button again,
the reply and forward messages should show up in the main window’s list. In Fig-
ure 14-31, they appear as messages 15 and 16 (the order they appear in may depend
on timing issues at your server, and I’ve stretched this horizontally in the GUI to try to
reveal the To header of the last of these).


Figure 14-31. PyMailGUI mail list after sends and load


Keep in mind that PyMailGUI runs on the local computer, but the messages you see in
the main window’s list actually live in a mailbox on your email server machine. Every
time we press Load, PyMailGUI downloads but does not delete newly arrived emails’
headers from the server to your computer. The three messages we just wrote (14
through 16) will also appear in any other email program you use on your account (e.g.,
in Outlook or in a webmail interface). PyMailGUI does not automatically delete mes-
sages as they are downloaded, but simply stores them in your computer’s memory for
processing. If we now select message 16 and press View, we see the forward message
we sent, as in Figure 14-32.


A PyMailGUI Demo| 1047
Free download pdf