some refactoring, including using the appropriate DEFAULT_MAIL_SENDER option