NXP-16181 refactor method to send mail