Troubleshooting

Visual Basic Code | ASP Code

Common reason of e-mail account login problems or the messages not being received is one of the following: You can exact reason of the problem from MailBee's log file. To enable logging, set EnableLogging and LogFilePath properties of POP3 object.

If the problem persists, don't hesitate to contact our Technical Support Team to get a prompt and helpful reply.

This sample connects to the POP3 server transmitting password as clear text, and then completely retrieves first message in the mailbox (if any). POP3 session log is written into "C:\Temp\pop3_log.txt" file. All possible errors are handled.

[Visual Basic]:

Dim objPOP3, objMsg

' Create POP3 object
Set objPOP3 = CreateObject("MailBee.POP3")

' Enable logging POP3 session into a file
objPOP3.EnableLogging = True
objPOP3.LogFilePath = "C:\Temp\pop3_log.txt"

' Unlock POP3 object
objPOP3.LicenseKey = "put your license key here"

' Set POP3 server name
objPOP3.ServerName = "mail.server.com"

' Set user credentials
objPOP3.UserName = "username"
objPOP3.Password = "password"

' Connect to the server and log in the mailbox
If objPOP3.Connect Then

  ' Download first message completely
  Set objMsg = objPOP3.RetrieveSingleMessage(1)

  If Not objPOP3.IsError Then
    ' Display message body
    MsgBox objMsg.BodyText
  Else
    ' Display error information
    MsgBox "Error #" & objPOP3.ErrCode & ", " & objPOP3.ErrDesc
  End If

  ' Close the connection
  objPOP3.Disconnect
Else
  ' Display error information
  MsgBox "Error #" & objPOP3.ErrCode
  MsgBox "Server response: " & objPOP3.ServerResponse
End If

[ASP]:

<%
Dim objPOP3, objMsg

' Create POP3 object
Set objPOP3 = Server.CreateObject("MailBee.POP3")

' Enable logging POP3 session into a file
objPOP3.EnableLogging = True
objPOP3.LogFilePath = "C:\Temp\pop3_log.txt"

' Unlock POP3 object
objPOP3.LicenseKey = "put your license key here"

' Set POP3 server name
objPOP3.ServerName = "mail.server.com"

' Set user credentials
objPOP3.UserName = "username"
objPOP3.Password = "password"

' Connect to the server and log in the mailbox
If objPOP3.Connect Then

  ' Download first message completely
  Set objMsg = objPOP3.RetrieveSingleMessage(1)

  If Not objPOP3.IsError Then
    ' Display message body
    Response.Write objMsg.BodyText
  Else
    ' Display error information
    Response.Write "Error #" & objPOP3.ErrCode & ", " & objPOP3.ErrDesc
  End If

  ' Close the connection
  objPOP3.Disconnect
Else
  ' Display error information
  Response.Write "Error #" & objPOP3.ErrCode & "<br>"
  Response.Write "Server response: " & objPOP3.ServerResponse
End If
%>
See Also:
ErrCode Property
ErrDesc Property
ServerResponse Property

 


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