factored out a SendEmail method