edit send email function