Attachment.CreateAttachmentFromString Method (String, ContentType)

 

Creates a mail attachment using the content from the specified string, and the specified ContentType.

Namespace:   System.Net.Mail
Assembly:  System (in System.dll)

public static Attachment CreateAttachmentFromString(
	string content,
	ContentType contentType
)

Parameters

content
Type: System.String

A String that contains the content for this attachment.

contentType
Type: System.Net.Mime.ContentType

A ContentType object that represents the Multipurpose Internet Mail Exchange (MIME) protocol Content-Type header to be used.

Return Value

Type: System.Net.Mail.Attachment

An object of type Attachment.

.NET Framework
Available since 2.0
Return to top
Show: