PersonalStorage.AddAttachmentToMessage

AddAttachmentToMessage(MessageInfo, string, Stream)

Adds an attachment to the specified message using the provided stream as attachment content.

public void AddAttachmentToMessage(MessageInfo messageInfo, string name, Stream stream)
ParameterTypeDescription
messageInfoMessageInfoThe MessageInfo object representing the target message.
nameStringThe name of the attachment to add.
streamStreamThe stream containing the attachment data.

Exceptions

exceptioncondition
ArgumentNullExceptionThrown if messageInfo, name, or stream is null or empty.

Remarks

The provided stream is not closed or disposed by this method.

See Also


AddAttachmentToMessage(MessageInfo, string)

Adds an attachment to the specified message using the file located at the provided path.

public void AddAttachmentToMessage(MessageInfo messageInfo, string filePath)
ParameterTypeDescription
messageInfoMessageInfoThe MessageInfo object representing the target message.
filePathStringThe full path to the file to be added as an attachment.

Exceptions

exceptioncondition
ArgumentNullExceptionThrown if messageInfo or filePath is null or empty.
FileNotFoundExceptionThrown if the file specified by filePath does not exist.

See Also


AddAttachmentToMessage(string, string, Stream)

Adds an attachment to the message identified by the specified entry ID using the provided stream.

public void AddAttachmentToMessage(string entryId, string name, Stream stream)
ParameterTypeDescription
entryIdStringThe entry ID of the target message.
nameStringThe name of the attachment to add.
streamStreamThe stream containing the attachment data.

Exceptions

exceptioncondition
ArgumentNullExceptionThrown if entryId, name, or stream is null or empty.

Remarks

The provided stream is not closed or disposed by this method.

See Also


AddAttachmentToMessage(string, string)

Adds an attachment to the message identified by the specified entry ID using the file located at the provided path.

public void AddAttachmentToMessage(string entryId, string filePath)
ParameterTypeDescription
entryIdStringThe entry ID of the target message.
filePathStringThe full path to the file to be added as an attachment.

Exceptions

exceptioncondition
ArgumentNullExceptionThrown if entryId or filePath is null or empty.
FileNotFoundExceptionThrown if the file specified by filePath does not exist.

See Also