示例#1
0
        public static string ComposeHtmlTextEmailBody(string from, string to, string subject, string htmlbody, string textbody)
        {
            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers.Add("From", from);
            headers.Add("To", to);
            headers.Add("Subject", subject);
            string strHeader = Kooboo.Mail.Multipart.HeaderComposer.Compose(headers);

            var bodycomposer = new Kooboo.Mail.Multipart.BodyComposer(htmlbody, textbody);

            return(strHeader + bodycomposer.Body());
        }
示例#2
0
        public static string ComposeMessageBody(ViewModel.ComposeViewModel model, User user)
        {
            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers.Add("From", GetFrom(model, user));

            var to = model.To;

            to.AddRange(model.Cc);

            headers.Add("To", ToAddress(to));
            headers.Add("Subject", model.Subject);

            string strHeader = Kooboo.Mail.Multipart.HeaderComposer.Compose(headers);

            var bodycomposer = new Kooboo.Mail.Multipart.BodyComposer(model.Html, model.Attachments, user);

            return(strHeader + bodycomposer.Body());
        }