MimeEntity.SetContent Method
Namespace: Rebex.Mime
Assembly: Rebex.Mail.dll (version 7.0.9119)
SetContent(String)
Sets the content of this entity to the specified text.
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 entity to the specified text and media type.
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 entity to the specified text, media type and character set.
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 entity to the specified text, media type and character set.
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. |
SetContent(MimeEntity)
Sets the inner message of this entity to the specified message.
Declaration
public void SetContent(MimeEntity entity)
Parameters
Type | Name | Description |
---|---|---|
MimeEntity | entity | Entity. |
Remarks
Media type is set to 'message/rfc822'.
SetContent(Stream, String, String, TransferEncoding)
Sets the content of this entity to data read from the specified stream and sets media type, file name and transfer encoding.
Declaration
public void SetContent(Stream source, string name, string mediaType, TransferEncoding transferEncoding)
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. |
TransferEncoding | transferEncoding | Transfer encoding. |
SetContent(Stream, String, String)
Sets the content of this entity 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, or null if no file name is to be assigned. |
String | mediaType | Media type. |
SetContent(Stream, String)
Sets the content of this entity to data read from the specified stream and sets media type and 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, or null if no file name is to be assigned. |
Remarks
Media type is set to 'application/octet-stream'.
SetContent(Stream)
Sets the content of this entity to data read from the specified stream.
Declaration
public void SetContent(Stream source)
Parameters
Type | Name | Description |
---|---|---|
Stream | source | Source stream to read data from. |
Remarks
File name is not set automatically. Set it manually using Name if needed. Media type is set to 'application/octet-stream'.