modify testapp to support sending mail