Ejemplo n.º 1
0
        public SerializeableMailMessage(MailMessage mailMessage)
        {
            To          = new List <SerializeableMailAddress>();
            CC          = new List <SerializeableMailAddress>();
            Bcc         = new List <SerializeableMailAddress>();
            ReplyToList = new List <SerializeableMailAddress>();

            AlternateViews = new List <SerializeableAlternateView>();

            Attachments = new List <SerializeableAttachment>();

            IsBodyHtml = mailMessage.IsBodyHtml;
            Body       = mailMessage.Body;
            Subject    = mailMessage.Subject;
            From       = new SerializeableMailAddress(mailMessage.From);

            foreach (MailAddress ma in mailMessage.To)
            {
                To.Add(new SerializeableMailAddress(ma));
            }

            foreach (MailAddress ma in mailMessage.CC)
            {
                CC.Add(new SerializeableMailAddress(ma));
            }

            foreach (MailAddress ma in mailMessage.Bcc)
            {
                Bcc.Add(new SerializeableMailAddress(ma));
            }

            Attachments = new List <SerializeableAttachment>();
            foreach (Attachment att in mailMessage.Attachments)
            {
                Attachments.Add(new SerializeableAttachment(att));
            }

            BodyEncoding = mailMessage.BodyEncoding;

            DeliveryNotificationOptions = mailMessage.DeliveryNotificationOptions;
            Headers  = new SerializeableCollection(mailMessage.Headers);
            Priority = mailMessage.Priority;

            foreach (MailAddress ma in mailMessage.ReplyToList)
            {
                ReplyToList.Add(new SerializeableMailAddress(ma));
            }

            if (mailMessage.Sender != null)
            {
                Sender = new SerializeableMailAddress(mailMessage.Sender);
            }

            SubjectEncoding = mailMessage.SubjectEncoding;

            foreach (AlternateView av in mailMessage.AlternateViews)
            {
                AlternateViews.Add(new SerializeableAlternateView(av));
            }
        }
Ejemplo n.º 2
0
 public SerializeableContentType(ContentType contentType)
 {
     Boundary   = contentType.Boundary;
     CharSet    = contentType.CharSet;
     MediaType  = contentType.MediaType;
     Name       = contentType.Name;
     Parameters = new SerializeableCollection(contentType.Parameters);
 }
Ejemplo n.º 3
0
 public SerializeableContentDisposition(ContentDisposition contentDisposition)
 {
     CreationDate     = contentDisposition.CreationDate;
     DispositionType  = contentDisposition.DispositionType;
     FileName         = contentDisposition.FileName;
     Inline           = contentDisposition.Inline;
     ModificationDate = contentDisposition.ModificationDate;
     Parameters       = new SerializeableCollection(contentDisposition.Parameters);
     ReadDate         = contentDisposition.ReadDate;
     Size             = contentDisposition.Size;
 }