CodepageMode Property


Indicates the mode of converting message content from Internet codepages into Windows codepages. This conversion takes place when messages are received from POP3 server.

Consider setting this property if "???" instead of international symbols appear in messages after decoding.

Also, this property is useful for handling Unicode (UTF7/UTF8) content because such content cannot be represented in ordinal 8bit characters.

For detailed description, see CodepageMode property reference of Message object. When decoding the message, POP3 object just passes POP3.CodepageMode property value to Message.CodepageMode property of every created Message object.

This property often used in conjunction with Codepage property.

Note: This property, if used, must be set BEFORE retrieving messages from the POP3 server. FIRST, set CodepageMode and/or Codepage properties and THEN call RetrieveMessages, RetrieveSingleMessageHeaders, etc. methods.


Value Type: Long
Parameters: None 

Usage example:

Dim Mailer, Msg
'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
      Mailer.CodepageMode = 2 ' Autodetect codepage, but for Unicode use Codepage property
      Mailer.Codepage = 932 ' iso-2022-jp when converting from Unicode
      Set Msg = Mailer.RetrieveSingleMessage(1)
      If Not Msg Is Nothing Then
        MsgBox Msg.BodyText
      End If
   End If
   Mailer.Disconnect
End If

See Also:

Codepage Property

RetrieveSingleMessage Method
RetrieveSingleMessageHeaders Method
RetrieveHeaders Method
RetrieveMessages Method

Message.Codepage Property
Message.CodepageMode Property


Copyright 2002-2008, AfterLogic Corporation. All rights reserved.