다음을 통해 공유


AttachmentCollection.Add Method (String, String)

The Add method adds a new Attachment object to the collection by using the file name specified by the fileName parameter and the content type specified by the contentType parameter.

Namespace: Microsoft.Exchange.Data.Transport.Email
Assembly: Microsoft.Exchange.Data.Transport (in microsoft.exchange.data.transport.dll)

Syntax

'Declaration
Public Function Add ( _
    fileName As String, _
    contentType As String _
) As Attachment
public Attachment Add (
    string fileName,
    string contentType
)
public:
Attachment^ Add (
    String^ fileName, 
    String^ contentType
)
public Attachment Add (
    String fileName, 
    String contentType
)
public function Add (
    fileName : String, 
    contentType : String
) : Attachment

Parameters

  • fileName
    The file name for the attachment to add to the collection.
  • contentType
    The content type for the attachment to add to the collection.

Remarks

If the contentType parameter is null or empty, the method uses application/octet-stream for the value of the contentType parameter.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003,

Target Platforms

Windows Server 2003