|
Summary
Local error has occurred. This will contain the error code indicating the type of error.
Description
The OnError event occurs when a method fails because the arguments are invalid or when a connection with the IMAP server can not be established The table below lists all the possible error
codes delivered by this event.
| ERR_IMAP_CANNOT_CONNECT |
Unable to connect to IMAP server. |
| ERR_IMAP_IN_ACTION |
Already performing action. |
| ERR_IMAP_CANNOT_PERFORM_ACTION |
Unable to perform action. Cannot initialize. |
| ERR_IMAP_INVALID_TIMEOUT |
Invalid Timeout value. |
| ERR_IMAP_FAILURE |
Server was unable to perform action. |
| ERR_IMAP_INVALID_HANDLE |
Invalid connection handle. A connection must be established before performing this action. |
| ERR_IMAP_ABORTED |
Action has been aborted and connection has been closed. |
| ERR_IMAP_CANNOT_INIT_WINSOCK |
Unable to initialize WINSOCK. |
| ERR_IMAP_TIMED_OUT |
IMAP timed out. |
| ERR_IMAP_NOSELECTED_MAILBOX |
A mailbox must be selected before performing this action. |
| ERR_IMAP_FILE_ERROR |
File IO error. |
| ERR_IMAP_INSUFFICIENT_LENGTH |
Insufficient length. |
| ERR_IMAP_CANNOT_SEND_COMMAND |
Unable to send command to IMAP server. |
| ERR_IMAP_INVALID_MAILBOX |
Mailbox is invalid. |
| ERR_IMAP_INVALID_OPTION |
Invalid option. |
| ERR_IMAP_INVALID_ARGUMENT |
Invalid argument. |
| ERR_IMAP_IN_APPEND |
Unable to perform this action while append is in progress. |
| ERR_INVALID_BUFSIZE |
Invalid buffer size specified in the DirectBufSize property. |
| ERR_IMAP_ABORT_FAILED |
Unable to abort. |
| ERR_IMAP_SOCKET_ERROR |
There was a socket error |
| ERR_IMAP_CONNECTION_CLOSED |
| The connection has been closed |
Example
Private Sub Imap_OnError(ErrorCode As Integer)
' The IMAP ActiveX control has fired the OnError event to
' deliver the an error code.
' translate code to message
Select Case (ErrorCode)
Case ERR_IMAP_CANNOT_CONNECT:
Message = "Unable to connect to IMAP server."
Case ERR_IMAP_IN_ACTION:
Message = "Already performing action."
Case ERR_IMAP_ABORTED:
Message = "Action has been aborted and connection has been closed."
Selected = False ' no longer selected
Connected = False ' no longer connected
Case ERR_IMAP_CANNOT_INIT_WINSOCK:
Message = "Unable to initialize WINSOCK."
.
.
Case Else
Message = "Unknown error has occurred"
End Select
'display error message
MsgBox Message, 64, "IMAP Client Sample"
End Sub
|