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)
| Parameter | Type | Description |
|---|
| messageInfo | MessageInfo | The MessageInfo object representing the target message. |
| name | String | The name of the attachment to add. |
| stream | Stream | The stream containing the attachment data. |
Exceptions
| exception | condition |
|---|
| ArgumentNullException | Thrown if messageInfo, name, or stream is null or empty. |
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)
| Parameter | Type | Description |
|---|
| messageInfo | MessageInfo | The MessageInfo object representing the target message. |
| filePath | String | The full path to the file to be added as an attachment. |
Exceptions
| exception | condition |
|---|
| ArgumentNullException | Thrown if messageInfo or filePath is null or empty. |
| FileNotFoundException | Thrown 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)
| Parameter | Type | Description |
|---|
| entryId | String | The entry ID of the target message. |
| name | String | The name of the attachment to add. |
| stream | Stream | The stream containing the attachment data. |
Exceptions
| exception | condition |
|---|
| ArgumentNullException | Thrown if entryId, name, or stream is null or empty. |
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)
| Parameter | Type | Description |
|---|
| entryId | String | The entry ID of the target message. |
| filePath | String | The full path to the file to be added as an attachment. |
Exceptions
| exception | condition |
|---|
| ArgumentNullException | Thrown if entryId or filePath is null or empty. |
| FileNotFoundException | Thrown if the file specified by filePath does not exist. |
See Also