# EmailBodyResource

Operation-scoped attachment resource resolved by CID, content location, or filename.

Class 

`OfficeIMO.Email`

**Namespace**

`OfficeIMO.Email`

**Assembly**

`OfficeIMO.Email.Html`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[EmailBodyResource.cs:48](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Email.Html/EmailBodyResource.cs#L48)

**Modifiers**

sealed

Operation-scoped attachment resource resolved by CID, content location, or filename.

## Inheritance

- object
- EmailBodyResource

## Usage

Explore 2 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 2

- Method [EmailBodyProjectionResult.ResolveResource](/api/email-html/officeimo-email-emailbodyprojectionresult/#method-resolveresource-string-uri)
- Property [EmailBodyProjectionResult.Resources](/api/email-html/officeimo-email-emailbodyprojectionresult/#property-resources)

Filter members 

Show inherited

## Methods

`public void CopyTo(Stream destination, CancellationToken cancellationToken = default)` [#](#method-copyto-io-stream-threading-cancellationtoken)

[EmailBodyResource.cs:88](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Email.Html/EmailBodyResource.cs#L88)

Copies this resource to a caller-owned destination without materializing another byte array.

Parameters

**destination System.IO.Stream required**

**cancellationToken System.Threading.CancellationToken = default optional**

`public async Task CopyToAsync(Stream destination, CancellationToken cancellationToken = default)` [#](#method-copytoasync-io-stream-threading-cancellationtoken)

Asynchronously copies this resource to a caller-owned destination.

Parameters

**destination System.IO.Stream required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task`

`public Stream OpenReadStream(CancellationToken cancellationToken = default)` [#](#method-openreadstream-threading-cancellationtoken)

[EmailBodyResource.cs:48](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Email.Html/EmailBodyResource.cs#L48)

Opens a fresh sequential stream governed by the per-resource and projection-wide budgets.

Parameters

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Stream`

`public async Task<Stream> OpenReadStreamAsync(CancellationToken cancellationToken = default)` [#](#method-openreadstreamasync-threading-cancellationtoken)

Asynchronously opens a fresh sequential stream governed by the configured budgets.

Parameters

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<Stream>`

`public byte[] ReadAllBytes(CancellationToken cancellationToken = default)` [#](#method-readallbytes-threading-cancellationtoken)

[EmailBodyResource.cs:115](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Email.Html/EmailBodyResource.cs#L115)

Reads this resource within the configured budgets.

Parameters

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`byte[]`

`public async Task<byte[]> ReadAllBytesAsync(CancellationToken cancellationToken = default)` [#](#method-readallbytesasync-threading-cancellationtoken)

Asynchronously reads this resource within the configured budgets.

Parameters

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<byte[]>`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public string ContentType { get; }` [#](#property-contenttype)

[EmailBodyResource.cs:36](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Email.Html/EmailBodyResource.cs#L36)

Content type declared by the artifact.

`public long Length { get; }` [#](#property-length)

[EmailBodyResource.cs:38](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Email.Html/EmailBodyResource.cs#L38)

Declared decoded length.

`public string? ContentId { get; }` [#](#property-contentid)

[EmailBodyResource.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Email.Html/EmailBodyResource.cs#L40)

Normalized Content-ID without angle brackets.

`public string? ContentLocation { get; }` [#](#property-contentlocation)

[EmailBodyResource.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Email.Html/EmailBodyResource.cs#L42)

Content-Location retained by the artifact.

`public string? FileName { get; }` [#](#property-filename)

[EmailBodyResource.cs:44](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Email.Html/EmailBodyResource.cs#L44)

Safe filename retained by the artifact.

<!-- PowerForge markdown artifact sha256:FBC8504EF9E3F2149078D4CC9600C4E53F128D5E04D197FDF22A3243F3CB68E0 -->
