Rebex
Products Downloads Buy Support Contact
Show / Hide Table of Contents

Ews.AddAttachmentAsync Method

Namespace: Rebex.Net
Assembly: Rebex.Ews.dll (version 8.0.9673)

AddAttachmentAsync(EwsItemId, String, Object)

Adds a file as new attachment to an exchange item.

Declaration
public Task<EwsAttachmentId> AddAttachmentAsync(EwsItemId itemId, string filePath, object state = null)
Parameters
Type Name Description
EwsItemId itemId

ID of an item to which to add the attachment.

String filePath

Path to a file to read attachment data from.

Object state

An object containing state information for this request.

Returns
Type Description
Task<EwsAttachmentId>

EwsAttachmentId of the new attachment.

AddAttachmentAsync(EwsItemId, String, String, Object)

Adds a file as new attachment to an exchange item.

Declaration
public Task<EwsAttachmentId> AddAttachmentAsync(EwsItemId itemId, string filePath, string contentType, object state = null)
Parameters
Type Name Description
EwsItemId itemId

ID of an item to which to add the attachment.

String filePath

Path to a file to read attachment data from.

String contentType

Content type of an attachment. For predefined strings see MediaTypeNames subclass's constants.

Object state

An object containing state information for this request.

Returns
Type Description
Task<EwsAttachmentId>

EwsAttachmentId of the new attachment.

AddAttachmentAsync(EwsItemId, String, Stream, Object)

Adds a stream as new attachment to an exchange item.

Declaration
public Task<EwsAttachmentId> AddAttachmentAsync(EwsItemId itemId, string name, Stream input, object state = null)
Parameters
Type Name Description
EwsItemId itemId

ID of an item to which to add the attachment.

String name

Display name of new attachment.

Stream input

A stream to read attachment data from.

Object state

An object containing state information for this request.

Returns
Type Description
Task<EwsAttachmentId>

EwsAttachmentId of the new attachment.

AddAttachmentAsync(EwsItemId, String, Stream, String, Object)

Adds a stream as new attachment to an exchange item.

Declaration
public Task<EwsAttachmentId> AddAttachmentAsync(EwsItemId itemId, string name, Stream input, string contentType, object state = null)
Parameters
Type Name Description
EwsItemId itemId

ID of an item to which to add the attachment.

String name

Display name of new attachment.

Stream input

A stream to read attachment data from.

String contentType

Content type of an attachment. For predefined strings see MediaTypeNames subclasses's constants.

Object state

An object containing state information for this request.

Returns
Type Description
Task<EwsAttachmentId>

EwsAttachmentId of the new attachment.

AddAttachmentAsync(EwsItemId, MimeMessage, Object)

Adds a MIME message as new attachment to an exchange item.

Declaration
public Task<EwsAttachmentId> AddAttachmentAsync(EwsItemId itemId, MimeMessage message, object state = null)
Parameters
Type Name Description
EwsItemId itemId

ID of an item to which to add the attachment.

MimeMessage message

A MIME message to attach.

Object state

An object containing state information for this request.

Returns
Type Description
Task<EwsAttachmentId>

EwsAttachmentId of the new attachment.

AddAttachmentAsync(EwsItemId, MailMessage, Object)

Add a mail message as new attachment to an exchange item.

Declaration
public Task<EwsAttachmentId> AddAttachmentAsync(EwsItemId itemId, MailMessage mail, object state = null)
Parameters
Type Name Description
EwsItemId itemId

ID of an item to which to add the attachment.

MailMessage mail

A Mail message to attach.

Object state

An object containing state information for this request.

Returns
Type Description
Task<EwsAttachmentId>

EwsAttachmentId of the new attachment.

AddAttachmentAsync(EwsItemId, String, Byte[], Object)

Add a MIME raw data as new attachment to an exchange item.

Declaration
public Task<EwsAttachmentId> AddAttachmentAsync(EwsItemId itemId, string name, byte[] mimeContent, object state = null)
Parameters
Type Name Description
EwsItemId itemId

ID of an item to which to add the attachment.

String name

Display name of new attachment.

Byte[] mimeContent

Raw MIME data.

Object state

An object containing state information for this request.

Returns
Type Description
Task<EwsAttachmentId>

EwsAttachmentId of the new attachment.

In This Article
© REBEX ČR s.r.o. Back to top
Privacy policy
Manage cookies