Email implementation

Not yet complete, but...