Backport to Python 2.6 of the SMTPHandler in higher versions.