ErrCode Property

Returns completion status of the last operation.

ErrCode is an extended numeric version of the IsError property. To get text message, use ErrDesc or ServerStatusResponse property.

The list of possible values is as follows (codes 0 - 14 are common for POP3, IMAP4 and SMTP objects, codes 3xx are specific to IMAP4 object):

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

Usage example:

' This sample tries to select non-existent mailbox and checks for errors
Dim Mailer
'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.LicenseKey = "put your license key here"
Mailer.Connect "", 143, "MyName", "MyPassword"
Mailer.SelectMailbox "Non-existent mailbox"
If Mailer.ErrCode > 0 Then
  MsgBox "ErrCode = " & Mailer.ErrCode
  MsgBox "ErrDesc = " & Mailer.ErrDesc
  If Mailer.ErrCode > 310 Then
    ' It seems the server returned error message for us
    MsgBox "Server responded: " & Mailer.ServerStatusResponse
  End If
End If

See Also:

IsError Property
ErrDesc Property
ServerStatusResponse Property

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