internal void                    WriteTo(MimeWriter writer)
 {
     for (int i = 0; i < Count; ++i)
     {
         base[i].WriteTo(writer);
     }
 }
Exemplo n.º 2
0
        internal virtual void                    WriteContentTo(MimeWriter writer)
        {
            if (writer is null)
            {
                throw new ArgumentNullException(nameof(writer));
            }

            writer.WriteContent(_content, _contentLength, ContentTransferEncoding);
        }
        public void                WriteTo(MimeWriter writer)
        {
            for (int i = 0; i < Count; ++i)
            {
                if (i > 0)
                {
                    writer.WriteAddressSep();
                }

                base[i].WriteTo(writer);
            }
        }
 internal void                    WriteTo(MimeWriter writer)
 {
     if (_name != "Bcc")
     {
         if (_valueObject is IMimeWriterTo value)
         {
             writer.WriteHeaderField(_name, value);
         }
         else
         {
             writer.WriteHeaderField(_name, _value);
         }
     }
 }
 public void                WriteTo(Stream stream)
 {
     using (MimeWriter Writer = new MimeWriter(stream)) {
         if (WriteHasData)
         {
             WriteTo(Writer);
         }
         else
         {
             if (_body != null && _body.Length > 0)
             {
                 Writer.WriteBody(_body);
             }
         }
     }
 }
        public void                WriteTo(MimeWriter writer)
        {
            if (writer is null)
            {
                throw new ArgumentNullException(nameof(writer));
            }

            writer.WriteFieldValue(_type);

            if (_parameters != null)
            {
                for (int i = 0; i < Parameters.Count; ++i)
                {
                    writer.WriteFieldParameter(Parameters[i]);
                }
            }
        }
Exemplo n.º 7
0
        public void                    WriteTo(MimeWriter writer)
        {
            if (writer is null)
            {
                throw new ArgumentNullException(nameof(writer));
            }

            Fields.WriteTo(writer);
            writer.WriteNewLine();

            if (this is MimeMessage)
            {
                writer.WriteMimeText();
            }

            WriteContentTo(writer);
        }
        internal override void                WriteContentTo(MimeWriter writer)
        {
            MimeField FldContentType = Fields["Content-Type"];

            if (FldContentType != null && FldContentType.ValueContentType.isMultipart)
            {
                for (int i = 0; i < _parts.Count; ++i)
                {
                    writer.WriteBoundary(ContentType.Boundary, false);
                    _parts[i].WriteTo(writer);
                }

                writer.WriteBoundary(ContentType.Boundary, true);
            }
            else
            {
                if (_parts != null && _parts.Count > 0)
                {
                    throw new MimeException("Part is multipart but content-type is not.");
                }

                base.WriteContentTo(writer);
            }
        }
 public void                WriteTo(MimeWriter writer)
 {
     writer.WriteAddress(_address, _displayName);
 }