Method SetContent
| Improve this Doc View SourceSetContent(HttpContent?)
Sets the actual attachment content to upload.
Declaration
public AttachmentOptions SetContent(HttpContent? content)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpContent | content |
Returns
| Type | Description |
|---|---|
| AttachmentOptions |
Remarks
Cannot be set when referencing an existing attachment.
SetContent(Stream, string?)
Sets the actual attachment content to upload.
Declaration
public AttachmentOptions SetContent(Stream content, string? mediaType = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | content | |
| string | mediaType |
Returns
| Type | Description |
|---|---|
| AttachmentOptions |
Remarks
Cannot be set when referencing an existing attachment.
SetContent(ArraySegment<byte>, string?)
Sets the actual attachment content to upload.
Declaration
public AttachmentOptions SetContent(ArraySegment<byte> content, string? mediaType = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ArraySegment<byte> | content | |
| string | mediaType |
Returns
| Type | Description |
|---|---|
| AttachmentOptions |
Remarks
Cannot be set when referencing an existing attachment.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown if |
SetContent(string, string?, Encoding?)
Sets the actual attachment content to upload.
Declaration
public AttachmentOptions SetContent(string content, string? mediaType = null, Encoding? encoding = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | content | |
| string | mediaType | Defaults to text/plain. |
| Encoding | encoding | Defaults to UTF8. |
Returns
| Type | Description |
|---|---|
| AttachmentOptions |
Remarks
Cannot be set when referencing an existing attachment.