Esempio n. 1
0
        internal void Write(TextWriter writer)
        {
            writer.Write(MimeVersionPrefix);
            writer.WriteLine(MimeVersion);
            if (RootPart != null)
            {
                RootPart.Write(writer);
            }

            if (IsMultipart)
            {
                boundary = RootPart.ContentTypeParameters["boundary"];
                if (string.IsNullOrEmpty(boundary))
                {
                    Error("Missing 'boundary' parameter on root Content-Type");
                }

                foreach (MimePart part in Parts)
                {
                    writer.Write("--");
                    writer.WriteLine(boundary);
                    part.Write(writer);
                }

                // write terminator
                writer.Write("--");
                writer.Write(boundary);
                writer.WriteLine("--");
            }
        }
 /// <inheritdoc />
 public void Write(string content)
 {
     RootPart.Write(content);
 }