GemBox.Email
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    ContentEntity Class

    Namespace:
    GemBox.Email.Mime
    Assembly:
    GemBox.Email.dll

    Represents MIME entity with single body.

    • C#
    • VB.NET
    public sealed class ContentEntity : Entity
    Public NotInheritable Class ContentEntity
        Inherits Entity
    Inheritance:
    System.Object
    Entity
    ContentEntity

    Constructors

    ContentEntity(MediaType, Byte[], TransferEncodingType, Encoding)

    Initializes a new instance of the ContentEntity class with specified content type, raw content, transfer encoding and charset.

    • C#
    • VB.NET
    public ContentEntity(MediaType contentType, byte[] content, TransferEncodingType encoding, Encoding charset)
    Public Sub New(contentType As MediaType, content As Byte(), encoding As TransferEncodingType, charset As Encoding)
    Parameters
    contentType
    MediaType

    Content-Type header value.

    content
    System.Byte[]

    The content. Can be null.

    encoding
    TransferEncodingType

    The content encoding.

    charset
    System.Text.Encoding

    The content charset. Can be null.

    Exceptions
    System.ArgumentException

    Content type top level type is multipart.

    FreeLimitReachedException

    Content size exceeds limitation.

    ContentEntity(MediaType, Stream, TransferEncodingType, Encoding)

    Initializes a new instance of the ContentEntity class with specified content type, raw content, transfer encoding and charset.

    • C#
    • VB.NET
    public ContentEntity(MediaType contentType, Stream content, TransferEncodingType encoding, Encoding charset)
    Public Sub New(contentType As MediaType, content As Stream, encoding As TransferEncodingType, charset As Encoding)
    Parameters
    contentType
    MediaType

    Content-Type header value.

    content
    System.IO.Stream

    The content.

    encoding
    TransferEncodingType

    The content encoding.

    charset
    System.Text.Encoding

    The content charset. Can be null.

    Exceptions
    System.ArgumentException

    Content type top level type is multipart.

    FreeLimitReachedException

    Content size exceeds limitation.

    Properties

    Charset

    Gets or sets the content charset.

    • C#
    • VB.NET
    public Encoding Charset { get; set; }
    Public Property Charset As Encoding
    Property Value
    System.Text.Encoding

    The content charset.

    Remarks

    Setting content charset value will re-encode the content. To avoid that, modify the Content-Type header directly.

    Content

    Gets the content.

    • C#
    • VB.NET
    public byte[] Content { get; }
    Public ReadOnly Property Content As Byte()
    Property Value
    System.Byte[]

    The content.

    Disposition

    Gets or sets the content disposition.

    • C#
    • VB.NET
    public string Disposition { get; set; }
    Public Property Disposition As String
    Property Value
    System.String

    The content disposition.

    IsMultipart

    Gets a value indicating whether this entity is multipart.

    • C#
    • VB.NET
    public override bool IsMultipart { get; }
    Public Overrides ReadOnly Property IsMultipart As Boolean
    Property Value
    System.Boolean

    True if this entity is multipart; otherwise, false.

    Overrides
    Entity.IsMultipart

    TransferEncoding

    Gets or sets the content transfer encoding.

    • C#
    • VB.NET
    public TransferEncodingType TransferEncoding { get; set; }
    Public Property TransferEncoding As TransferEncodingType
    Property Value
    TransferEncodingType

    The content transfer encoding.

    Remarks

    Setting content transfer encoding value will re-encode the content. To avoid that, modify the Content-Transfer-Encoding header directly.

    Methods

    Clone()

    Creates a copy of this ContentEntity instance.

    • C#
    • VB.NET
    public override Entity Clone()
    Public Overrides Function Clone As Entity
    Returns
    Entity

    The copy of this ContentEntity instance.

    Overrides
    Entity.Clone()

    DecodeContent()

    Decodes the Content.

    • C#
    • VB.NET
    public byte[] DecodeContent()
    Public Function DecodeContent As Byte()
    Returns
    System.Byte[]

    A decoded content.

    Remarks

    The method decodes the raw content using specifed TransferEncoding.

    Find(Func<Entity, Boolean>)

    Checks if this ContentEntity instance or one of its children satisfies a condition.

    • C#
    • VB.NET
    public override Entity Find(Func<Entity, bool> predicate)
    Public Overrides Function Find(predicate As Func(Of Entity, Boolean)) As Entity
    Parameters
    predicate
    System.Func<Entity, System.Boolean>

    A function to test each element for a condition.

    Returns
    Entity

    ContentEntity instance which satisfies a condition; otherwise, null.

    Overrides
    Entity.Find(Func<Entity, Boolean>)

    Inherited Properties

    ContentType

    Gets the Content-Type header value.

    (Inherited from Entity)

    Headers

    Gets the Entity headers.

    (Inherited from Entity)

    Parent

    Gets the Entity parent.

    (Inherited from Entity)

    Inherited Methods

    Find(MediaType)

    Checks if this Entity instance or one of its children matches the specified content type.

    (Inherited from Entity)

    Find(System.String)

    Checks if this Entity instance or one of its children matches the specified top level media type.

    (Inherited from Entity)

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.