Most important, if we ever change the header and footer format functions in the
commonhtml module, all our page’s headers and footers will automatically be updated.
If you are interested in seeing how this encapsulated logic works right now, flip ahead
to Example 16-14. We’ll explore its code after we study the rest of the mail site’s pages.
Using the Send Mail Script Outside a Browser
I initially wrote the send script to be used only within PyMailCGI using values typed
into the mail edit form. But as we’ve seen, inputs can be sent in either form fields or
URL query parameters. Because the send mail script checks for inputs in CGI inputs
before importing from the mailconfig module, it’s also possible to call this script outside
the edit page to send email—for instance, explicitly typing a URL of this nature into
your browser’s address field (but all on one line and with no intervening spaces):
http://localhost:8000/cgi-bin/
onEditPageSend.py?site=smtp.rmi.net&
[email protected]&
[email protected]&
Subject=test+url&
text=Hello+Mark;this+is+Mark
Figure 16-5. PyMailCGI send error page
Sending Mail by SMTP| 1247