@shaggs' email plugin

This is a replacement for the changes in #7.

It needs a bit of love and testing.