Issue #23511: Port email-simple.py to Python 3.

Also, update email examples to use the context manager version of open().

Patch by Baptiste Mispelon.
4 files changed