class EmailService {

    public boolean sendRecoveryCode(String name, String email, String code) {
        HtmlEmail htmlEmail;
        try {
            htmlEmail = sendMailSsl.initializeMail(email);
        } catch (EmailException e) {
            ConsoleLogger.logException("Failed to create email for recovery code:", e);
            return false;
        }

        String message = replaceTagsForRecoveryCodeMail(settings.getRecoveryCodeEmailMessage(),
            name, code, settings.getProperty(SecuritySettings.RECOVERY_CODE_HOURS_VALID));
        return sendMailSsl.sendEmail(message, htmlEmail);
    }

    @Inject  EmailService(@DataFolder File dataFolder, Server server, Settings settings, SendMailSsl sendMailSsl);

}