Fixed #22407 -- Added BaseEmailHandler to allow customizing mail senders.

https://code.djangoproject.com/ticket/22407
I'd put this class in the test method for easier reference.