GetBodyFormat Method

Get message body format.

[Syntax]
C++: HRESULT GetBodyFormat( long* pVal )
Visual Basic: GetBodyFormat() As long
C#: long GetBodyFormat

Return Value

Value Meaning
0 TEXT/PLAIN
1 TEXT/HTML
2 MULTIPART/ALTERNAVTIVE

Remarks

Sometimes, an email consists of two bodies. One is in TEXT/HTML format, and another is in TEXT/PLAIN format. It is called multipart/alternative format. In this case, you may use method GetAltBody() to get TEXT/PLAIN part, and use method GetBodyText to get TEXT/HTML part.

GetAltBody returns nothing if BodyFormat is TEXT/HTML.

Usage Example

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

  Dim nRet As Integer
  If  oMsg.ImportFile( emailFile ) <> 0 Then
    MsgBox "error with ImportFile" 
    Exit Sub
  End If
  nRet = oMsg.GetBodyFormat() 

  Select Case nRet: 
  Case 0:
    MsgBox "TEXT/PLAIN" 
  Case 1: 
    MsgBox "TEXT/HTML" 
  Case 2:
    MsgBox "MULTIPART/ALTERNAVTIVE" 
  End Select
End Sub

See Also

GetBodyText Method
GetAltBody Method


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