in an upcoming section we’ll see a different approach that allows this module to be
extended externally.
Example 14-9. PP4E\Internet\Email\PyMailGui\mailconfig.py
"""
################################################################################
PyMailGUI user configuration settings.
Email scripts get their server names and other email config options from
this module: change me to reflect your machine names, sig, and preferences.
This module also specifies some widget style preferences applied to the GUI,
as well as message Unicode encoding policy and more in version 3.0. See
also: local textConfig.py, for customizing PyEdit pop-ups made by PyMailGUI.
Warning: PyMailGUI won't run without most variables here: make a backup copy!
Caveat: somewhere along the way this started using mixed case inconsistently...;
TBD: we could get some user settings from the command line too, and a configure
dialog GUI would be better, but this common module file suffices for now.
################################################################################
"""
#-------------------------------------------------------------------------------
(required for load, delete) POP3 email server machine, user;
#-------------------------------------------------------------------------------
#popservername = '?Please set your mailconfig.py attributes?'
popservername = 'pop.secureserver.net' # see altconfigs/ for others
popusername = '[email protected]'
#-------------------------------------------------------------------------------
(required for send) SMTP email server machine name;
see Python smtpd module for a SMTP server class to run locally ('localhost');
note: your ISP may require that you be directly connected to their system:
I once could email through Earthlink on dial up, but not via Comcast cable;
#-------------------------------------------------------------------------------
smtpservername = 'smtpout.secureserver.net'
#-------------------------------------------------------------------------------
(optional) personal information used by PyMailGUI to fill in edit forms;
if not set, does not fill in initial form values;
signature -- can be a triple-quoted block, ignored if empty string;
address -- used for initial value of "From" field if not empty,
no longer tries to guess From for replies--varying success;
#-------------------------------------------------------------------------------
myaddress = '[email protected]'
mysignature = ('Thanks,\n'
'--Mark Lutz (http://learning-python.com, http://rmi.net/~lutz)')'))
#-------------------------------------------------------------------------------
(may be required for send) SMTP user/password if authenticated;
set user to None or '' if no login/authentication is required, and set
1106 | Chapter 14: The PyMailGUI Client