Backend of email system done.

Still haven't done the website part though.