Ejemplo n.º 1
0
        internal static string MailTextGenerator(MailMessageTemplate template, User user)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("Уважаемый, {0} {1} !", user.FirstName, user.Patronime);
            sb.AppendLine(template.MessageText);
            sb.AppendLine();
            sb.AppendFormat("Логин: {0} .", user.Login);
            sb.AppendLine();
            sb.AppendFormat("Логин: {0} .", user.Password);
            return(sb.ToString());
        }
Ejemplo n.º 2
0
        public static MailMessage GetMailMessage(string toAdress, User user)
        {
            var         fromAddress = Properties.Resources.MailAdressFrom;
            var         receiver    = toAdress;
            var         text        = new MailMessageTemplate();
            MailMessage message     = new MailMessage(fromAddress, receiver)
            {
                Subject         = Properties.Resources.MailSubject,
                SubjectEncoding = System.Text.Encoding.UTF8,
                Body            = ResourceHelper.MailTextGenerator(text, user),
                BodyEncoding    = System.Text.Encoding.UTF8,
                IsBodyHtml      = false
            };

            return(message);
        }