Email with attachments

I have taken @glasser 's work and updated it with all the new code from origin/devel . Should be able to merge cleanly. 

I couldnt figure out how to run newly written tests, maybe a good idea to add that to the guidelines for contributing ?