Ejemplo n.º 1
0
        private void SendActivationMail(string mailTo, string code, string userName)
        {
            MailMessage msg = new MailMessage(LocalUser.GetPropertyValue(SystemProperties.SMTP_FROM), mailTo);

            msg.Subject = "Активация аккаунта";
            string        url  = Request.Url + "?Activate=" + code;
            string        href = String.Format("<a href=\"{0}\">{0}</a>", url);
            AlternateView av   = AlternateView.CreateAlternateViewFromString(String.Format(LocalUser.GetPropertyValue(SystemProperties.REGISTER_MAIL), userName, href),
                                                                             null, MediaTypeNames.Text.Html);

            msg.AlternateViews.Add(av);
            msg.IsBodyHtml = true;
            SendMail(msg);
        }