create send email function

figuring out intricacies of io.Writer and text templating was painful