Content Property


Contains the binary content of the attachment as a string.

If the attachment is, for example, a GIF file, Content property contains binary string of image bytes; if the attachment is a text file, Content property contains the text.

To get the attachment's content as an array use ContentAsArray property. This is useful for downloading files with ASP's BinaryWrite method.

In the case when the attachment was previously saved to disk, you can use GetFileAsArray method of the Message object to get file's content as array.

To save the attachment's content to disk, use SaveFile method.

Note: To determine the size of the attachment, it's more efficient to use Size property instead of Len(Attachment.Content).


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

Usage example:

Dim Mailer, Msg, Attach
'Using visual basic to create object
Set Mailer = CreateObject("MailBee.POP3")
'Using ASP to create object
'Set Mailer = Server.CreateObject("MailBee.POP3")
'In ASP use Response.Write instead of MsgBox
Mailer.LicenseKey = "put your license key here"
Mailer.Connect "mailserver.com", 110, "MyName", "MyPassword"
If Mailer.Connected Then
  If Mailer.MessageCount > 0 Then
    Set Msg = Mailer.RetrieveSingleMessage(1)
    If Not Msg Is Nothing Then
      For Each Attach In Msg.Attachments
        MsgBox "Content: " & Attach.Content
      Next
    End If
  End If
  Mailer.Disconnect
End If

See Also:

ContentAsArray Property
Filename Property
Size Property
SaveFile Method
IsInline Property

Message.GetFileAsArray Method


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