Email functions fleshed out and tested.