public void ReadXml(XmlReader reader)
        {
            string str;
            object obj;
            int    num;
            bool   flag;
            NameValueCollection          values;
            IList <Attachment>           attachment;
            ICollection <MailAddressXml> address;
            XmlDocument doc = new XmlDocument();

            doc.Load(reader);
            XmlNode xml = doc.SelectSingleNode("MailMessage");

            if (XmlLoader.GetStringValue(xml, "Body", out str))
            {
                base.Body = str;
            }
            if (XmlLoader.GetStringValue(xml, "Subject", out str))
            {
                base.Subject = str;
            }
            if (XmlLoader.GetCollectionValue <MailAddressXml>(xml, "Bcc/*", new MailAddressXml(), out address))
            {
                MailAddressXml.CopyCollection(address, base.Bcc);
            }
            if (XmlLoader.GetCollectionValue <MailAddressXml>(xml, "Cc/MailAddress", new MailAddressXml(), out address))
            {
                MailAddressXml.CopyCollection(address, base.CC);
            }
            if (XmlLoader.GetCollectionValue <MailAddressXml>(xml, "To/MailAddress", new MailAddressXml(), out address))
            {
                MailAddressXml.CopyCollection(address, base.To);
            }
            if (XmlLoader.GetSerializedObject(xml, "From/MailAddress", new MailAddressXml(), out obj))
            {
                base.From = ((MailAddressXml)obj).MailAddress;
            }
            if (XmlLoader.GetSerializedObject(xml, "ReplyTo/MailAddress", new MailAddressXml(), out obj))
            {
                base.ReplyTo = ((MailAddressXml)obj).MailAddress;
            }
            if (XmlLoader.GetSerializedObject(xml, "Sender/MailAddress", new MailAddressXml(), out obj))
            {
                base.Sender = ((MailAddressXml)obj).MailAddress;
            }
            if (XmlLoader.GetEnumValue(xml, "Priority", typeof(MailPriority), out obj))
            {
                base.Priority = (MailPriority)obj;
            }
            if (XmlLoader.GetBoolValue(xml, "IsBodyHtml", out flag))
            {
                base.IsBodyHtml = flag;
            }
            if (XmlLoader.GetCollectionValue(xml, "Headers", out values))
            {
                TypeHelper.CopyCollection(values, base.Headers);
            }
            if (XmlLoader.GetEnumValue(xml, "DeliveryNotificationOptions", typeof(DeliveryNotificationOptions), out obj))
            {
                base.DeliveryNotificationOptions = (DeliveryNotificationOptions)obj;
            }
            if (XmlLoader.GetIntValue(xml, "BodyEncoding", out num))
            {
                base.BodyEncoding = Encoding.GetEncoding(num);
            }
            if (XmlLoader.GetIntValue(xml, "SubjectEncoding", out num))
            {
                base.SubjectEncoding = Encoding.GetEncoding(num);
            }
            if (GetCollectionValue(xml, "Attachments/Attachment", out attachment))
            {
                TypeHelper.CopyCollection <Attachment>(attachment, base.Attachments);
            }
        }