GetContentType Method

Get file attachment's Content-Type.

[Syntax]
C++: HRESULT GetContentType( int nCount, BSTR* pVal )
Visual Basic: GetContentType( nCount As Long ) As String
C#: string GetContentType( int nCount )

Parameters

nCount

Ordinal number of file attachment. The minimum value is 1, the maximum value is returned by method GetAttachmentCount.

Return Value

If this method succeeds, the return value is Content-Type of this attachment, otherwise the return value is null.

Usage Example

[Visual Basic]
Dim oMsg As Object
Set oMsg = CreateObject("ANPOP.POPMSG")

Dim nCount As Integer
POPMSG.ImportFile "c:\test.eml"
nCount = oMsg.GetAttachmentCount()
For i = 1 To nCount
  MsgBox "Current attachment's content-type is " & oMsg.GetContentType(i)
Next  

See Also

GetAttachmentCount Method
GetAttachmentChunk Method
GetAttachmentSize Method
SaveAttachment Method
SaveAttachmentAs Method


2001-2007 © Copyright AdminSystem Software Limited. All rights reserved.