/// /// Returns the MailMessge object from the serializeable object /// /// public MailMessage GetMailMessage() { MailMessage mm = new MailMessage(); mm.IsBodyHtml = IsBodyHtml; mm.Body = Body; mm.Subject = Subject; if (From != null) { mm.From = From.GetMailAddress(); } foreach (SerializeableMailAddress ma in To) { mm.To.Add(ma.GetMailAddress()); } foreach (SerializeableMailAddress ma in CC) { mm.CC.Add(ma.GetMailAddress()); } foreach (SerializeableMailAddress ma in Bcc) { mm.Bcc.Add(ma.GetMailAddress()); } foreach (SerializeableAttachment att in Attachments) { mm.Attachments.Add(att.GetAttachment()); } mm.BodyEncoding = BodyEncoding; mm.DeliveryNotificationOptions = DeliveryNotificationOptions; Headers.SetColletion(mm.Headers); mm.Priority = Priority; if (ReplyTo != null) { mm.ReplyTo = ReplyTo.GetMailAddress(); } if (Sender != null) { mm.Sender = Sender.GetMailAddress(); } mm.SubjectEncoding = SubjectEncoding; foreach (SerializeableAlternateView av in AlternateViews) { mm.AlternateViews.Add(av.GetAlternateView()); } return(mm); }
internal void SetContentDisposition(ContentDisposition scd) { scd.CreationDate = CreationDate; scd.DispositionType = DispositionType; scd.FileName = FileName; scd.Inline = Inline; scd.ModificationDate = ModificationDate; Parameters.SetColletion(scd.Parameters); scd.ReadDate = ReadDate; scd.Size = Size; }
internal ContentType GetContentType() { ContentType sct = new ContentType(); sct.Boundary = Boundary; sct.CharSet = CharSet; sct.MediaType = MediaType; sct.Name = Name; Parameters.SetColletion(sct.Parameters); return(sct); }