Attachment.SetContent Method
Namespace: Rebex.Mail
Assembly: Rebex.Mail.dll (version 7.0.9083)
SetContent(Stream, String, String)
Sets the content of this attachment to data read from the specified stream and sets media type and file name.
Declaration
public void SetContent(Stream source, string name, string mediaType)
Parameters
Type | Name | Description |
---|---|---|
Stream | source | Source stream to read data from. |
String | name | File name to assign to the content. |
String | mediaType | Media type. |
SetContent(Stream, String)
Sets the content of this attachment to data read from the specified stream and sets file name.
Declaration
public void SetContent(Stream source, string name)
Parameters
Type | Name | Description |
---|---|---|
Stream | source | Source stream to read data from. |
String | name | File name to assign to the content. |
Remarks
Media type is set to 'application/octet-stream'.
SetContent(String)
Sets the content of this attachment to the specified text. Inherited from AttachmentBase.
Declaration
public void SetContent(string text)
Parameters
Type | Name | Description |
---|---|---|
String | text | Content to set. |
Remarks
Media type is set to 'text/plain'. Character set and transfer encoding are determined automatically.
SetContent(String, String)
Sets the content of this attachment to the specified text and media type. Inherited from AttachmentBase.
Declaration
public void SetContent(string text, string mediaType)
Parameters
Type | Name | Description |
---|---|---|
String | text | Content to set. |
String | mediaType | Media type. |
Remarks
Character set and transfer encoding are determined automatically.
SetContent(String, String, Encoding)
Sets the content of this attachment to the specified text, media type and character set. Inherited from AttachmentBase.
Declaration
public void SetContent(string text, string mediaType, Encoding charset)
Parameters
Type | Name | Description |
---|---|---|
String | text | Content to set. |
String | mediaType | Media type. |
Encoding | charset | Character set to use for encoding the text. |
Remarks
Transfer encoding is determined automatically.
SetContent(String, String, Encoding, TransferEncoding)
Sets the content of this attachment to the specified text, media type and character set. Inherited from AttachmentBase.
Declaration
public void SetContent(string text, string mediaType, Encoding charset, TransferEncoding transferEncoding)
Parameters
Type | Name | Description |
---|---|---|
String | text | Content to set. |
String | mediaType | Media type. |
Encoding | charset | Character set to use for encoding the text. |
TransferEncoding | transferEncoding | Transfer encoding. |