//public AttachmentCollection Attachments { get; }
        //public AlternateViewCollection AlternateViews { get; }

        private void Load(MailMessage m)
        {
            IsBodyHtml                  = m.IsBodyHtml;
            Priority                    = m.Priority;
            BodyTransferEncoding        = m.BodyTransferEncoding;
            DeliveryNotificationOptions = m.DeliveryNotificationOptions;
            if (m.Sender != null)
            {
                Sender = new MailAddressSerializable(m.Sender.Address, m.Sender.DisplayName);
            }
            if (m.From != null)
            {
                From = new MailAddressSerializable(m.From.Address, m.From.DisplayName);
            }
            foreach (MailAddress a in m.To)
            {
                To.Add(new MailAddressSerializable(a.Address, a.DisplayName));
            }
            foreach (MailAddress a in m.CC)
            {
                CC.Add(new MailAddressSerializable(a.Address, a.DisplayName));
            }
            foreach (MailAddress a in m.Bcc)
            {
                Bcc.Add(new MailAddressSerializable(a.Address, a.DisplayName));
            }
            foreach (MailAddress a in m.ReplyToList)
            {
                ReplyToList.Add(new MailAddressSerializable(a.Address, a.DisplayName));
            }
            Subject = m.Subject;
            Body    = m.Body;
            //output.AlternateViews = input.AlternateViews;
            //output.Attachments = input.Attachments;
        }
Exemple #2
0
        //public AttachmentCollection Attachments { get; }
        //public AlternateViewCollection AlternateViews { get; }

        private void Load(MailMessage m)
        {
            //Headers = new List<JocysCom.ClassLibrary.Collections.KeyValue>();
            //foreach (var key in m.Headers.AllKeys)
            //	Headers.Add(new JocysCom.ClassLibrary.Collections.KeyValue(key, m.Headers[key]));
            IsBodyHtml                  = m.IsBodyHtml;
            Priority                    = m.Priority;
            BodyTransferEncoding        = m.BodyTransferEncoding;
            DeliveryNotificationOptions = m.DeliveryNotificationOptions;
            if (m.Sender != null)
            {
                Sender = new MailAddressSerializable(m.Sender.Address, m.Sender.DisplayName);
            }
            if (m.From != null)
            {
                From = new MailAddressSerializable(m.From.Address, m.From.DisplayName);
            }
            foreach (MailAddress a in m.To)
            {
                To.Add(new MailAddressSerializable(a.Address, a.DisplayName));
            }
            foreach (MailAddress a in m.CC)
            {
                CC.Add(new MailAddressSerializable(a.Address, a.DisplayName));
            }
            foreach (MailAddress a in m.Bcc)
            {
                Bcc.Add(new MailAddressSerializable(a.Address, a.DisplayName));
            }
            foreach (MailAddress a in m.ReplyToList)
            {
                ReplyToList.Add(new MailAddressSerializable(a.Address, a.DisplayName));
            }
            Subject = m.Subject;
            Body    = m.Body;
            //output.AlternateViews = input.AlternateViews;
            //output.Attachments = input.Attachments;
        }