ContentSubType Property


Contains sub part of Content-Type of the MIME part.

For example, if Content-Type header looks like:

Content-Type: text/plain; charset=us-ascii

then ContentSubType property will return "plain".


Value Type: String
Parameters: None 
Remarks: This property is read-only

Usage example:

' This sample displays Content-Type for all parts
' and subparts of the first email in Inbox.

' This subroutine is recursive
Sub DisplayContentType(BodyPart)
  Dim Part
  MsgBox BodyPart.ContentCommonType & "/" & BodyPart.ContentSubType
  If BodyPart.IsMultipart Then
    For Each Part In BodyPart.SubParts
      DisplayContentType Part
    Next
  End If
End Sub

' Main code
Sub Main
  Dim Mailer, Envelopes, Envelope
  'Using visual basic to create object
  Set Mailer = CreateObject("MailBee.IMAP4")
  'Using ASP to create object
  'Set Mailer = Server.CreateObject("MailBee.IMAP4")
  'In ASP use Response.Write instead of MsgBox
  Mailer.EnableLogging = True
  Mailer.LogFilePath = "C:\Temp\imap4_log.txt"
  Mailer.ClearLog
  Mailer.LicenseKey = "put your license key here"
  If Mailer.Connect("mailserver.com", 143, "MyName", "MyPassword") Then
    If Mailer.SelectMailbox("Inbox") Then
      Set Envelopes = Mailer.RetrieveEnvelopesEx(1, 1, False, True)
      If Not Envelopes Is Nothing Then
        For Each Envelope In Envelopes
          DisplayContentType Envelope.BodyStructure
        Next
      End If
    End If
    Mailer.Disconnect
  End If
End Sub

See Also:

ContentCommonType Property
IsMultipart Property
SubParts Property

BodyPartStructure Object
Envelope Object


Copyright © 2002-2024, AfterLogic Corporation. All rights reserved.