Beispiel #1
0
        internal static Entity CreateMessageRfc822()
        {
            var entity           = new Entity();
            var contentTypeField = new ContentTypeHeaderField {
                BoundaryName = Boundary.Create(), MediaType = ContentTypes.MessageRfc822, Charset = Charsets.Ansi
            };

            entity.Headers.Add(contentTypeField);
            return(entity);
        }
Beispiel #2
0
        public static Entity Create(string contentType, string encoding, bool boundary)
        {
            var entity           = new Entity();
            var contentTypeField = new ContentTypeHeaderField {
                MediaType = contentType
            };

            if (boundary)
            {
                contentTypeField.BoundaryName = Boundary.Create();
            }

            var contentTransferEncodingField = new ContentTransferEncodingHeaderField {
                Encoding = encoding
            };

            entity.Headers.Add(contentTypeField);
            entity.Headers.Add(contentTransferEncodingField);
            return(entity);
        }