private void SendEmail()
    {
        EmailMessage      msg  = new CMS.EmailEngine.EmailMessage();
        EmailTemplateInfo eti  = EmailTemplateProvider.GetEmailTemplate("Membership.ChangedPassword", CMSContext.CurrentSiteID);
        string            pswd = passStrength.Text.Trim();

        ui = UserInfoProvider.GetUserInfo(CurrentUser.UserName);
        if (ui != null)
        {
            if (eti != null)
            {
                MacroResolver mcr = new MacroResolver();

                // Macros
                string[,] macros = new string[5, 2];
                macros[0, 0]     = "UserName";
                macros[0, 1]     = ui.UserName;
                macros[1, 0]     = "Password";
                macros[1, 1]     = pswd;

                ContextResolver resolver = MacroContext.CurrentResolver;
                resolver.SourceParameters     = macros;
                resolver.EncodeResolvedValues = true;

                msg.EmailFormat = EmailFormatEnum.Both;
                msg.From        = "*****@*****.**";
                msg.Recipients  = CurrentUser.Email;
                msg.Subject     = "Changement de mot de passe - Servranx";

                EmailSender.SendEmailWithTemplateText(SiteContext.CurrentSiteName, msg, eti, resolver, true);
            }
        }
    }
    private void SendEmail(string templateName, MacroResolver resolver, string emailTo)
    {
        CMS.EmailEngine.EmailMessage msg           = new CMS.EmailEngine.EmailMessage();
        EmailTemplateInfo            emailTemplate = EmailTemplateProvider.GetEmailTemplate(templateName, SiteContext.CurrentSiteID);

        msg.EmailFormat = EmailFormatEnum.Both;
        msg.From        = emailTemplate.TemplateFrom;
        msg.Recipients  = emailTo;
        if (resolver != null)
        {
            msg.Body = resolver.ResolveMacros(emailTemplate.TemplateText);
        }

        EmailSender.SendEmailWithTemplateText(SiteContext.CurrentSiteName, msg, emailTemplate, null, true);
    }