overhaul of email sending
Merge pull request #215 from apatel/master

overhaul of email sending