Attachment.CreateAttachmentFromString

CreateAttachmentFromString(string, string)

Creates a text attachment from a string.

public static Attachment CreateAttachmentFromString(string content, string name)
ParameterTypeDescription
contentStringThe content of the attachment.
nameStringThe file name of the attachment.

Return Value

The new attachment.

See Also


CreateAttachmentFromString(string, string, Encoding, string)

Creates an attachment from a string with the specified encoding and media type.

public static Attachment CreateAttachmentFromString(string content, string name, 
    Encoding contentEncoding, string mediaType)
ParameterTypeDescription
contentStringThe content of the attachment.
nameStringThe file name of the attachment.
contentEncodingEncodingThe character encoding of the content.
mediaTypeStringThe MIME media type of the content, such as text/html.

Return Value

The new attachment.

See Also


CreateAttachmentFromString(string, ContentType)

Creates an attachment from a string with the specified content type.

public static Attachment CreateAttachmentFromString(string content, ContentType contentType)
ParameterTypeDescription
contentStringThe content of the attachment.
contentTypeContentTypeThe content type of the attachment, including its name.

Return Value

The new attachment.

See Also