update send_email function