BodyStructure Property

Contains a reference to root BodyPartStructure object of the tree of MIME part structures of the message body.

Note: To get Envelope objects with BodyStructure property set, call RetrieveEnvelopesEx method of IMAP4 object with AlsoGetBodyStructure parameter set to True. Otherwise, BodyStructure property will return Nothing.

Value Type: MailBee.BodyPartStructure
Parameters: None 
Remarks: This property is read-only

Usage example:

' This sample displays message type (multipart or not) for the first email in Inbox
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.LicenseKey = "put your license key here"
If Mailer.Connect("", 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
        If Envelope.BodyStructure.IsMultipart Then
          MsgBox "Multipart message"
          MsgBox "Singlepart message"
        End If
    End If
  End If
End If

See Also:

MessagePreview Property

BodyPartStructure Object
Envelope Object

IMAP4.RetrieveEnvelopesEx Method

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