Troubleshooting
Dim objIMAP4, objMsg ' Create IMAP4 object Set objIMAP4 = CreateObject("MailBee.IMAP4") ' Enable logging IMAP4 session into a file objIMAP4.EnableLogging = True objIMAP4.LogFilePath = "C:\Temp\imap4_log.txt" ' Unlock IMAP4 object objIMAP4.LicenseKey = "put your license key here" ' Set IMAP4 server name objIMAP4.ServerName = "mail.server.com" ' Set user credentials objIMAP4.UserName = "username" objIMAP4.Password = "password" ' Connect to the server and ' log in email account If objIMAP4.Connect Then ' Select Inbox folder If objIMAP4.SelectMailbox("Inbox") Then ' Completely retrieve first message Set objMsg = objIMAP4.RetrieveSingleMessage(1) If Not objIMAP4.IsError Then ' Display the number of ' attachments in the message MsgBox "The message contains " & _ objMsg.Attachments.Count & " attachment(s)" Else ' Display error information MsgBox "Error #" & objIMAP4.ErrCode & ", " & objIMAP4.ErrDesc End If Else ' Display error information MsgBox "Error #" & objIMAP4.ErrCode MsgBox "Server response: " & objIMAP4.ServerResponse End If ' Close the connection objIMAP4.Disconnect Else ' Display error information MsgBox "Error #" & objIMAP4.ErrCode MsgBox "Server response: " & objIMAP4.ServerResponse End If
<% Dim objIMAP4, objMsg ' Create IMAP4 object Set objIMAP4 = Server.CreateObject("MailBee.IMAP4") ' Enable logging IMAP4 session into a file objIMAP4.EnableLogging = True objIMAP4.LogFilePath = "C:\Temp\imap4_log.txt" ' Unlock IMAP4 object objIMAP4.LicenseKey = "put your license key here" ' Set IMAP4 server name objIMAP4.ServerName = "mail.server.com" ' Set user credentials objIMAP4.UserName = "username" objIMAP4.Password = "password" ' Connect to the server and ' log in email account If objIMAP4.Connect Then ' Select Inbox folder If objIMAP4.SelectMailbox("Inbox") Then ' Completely retrieve first message Set objMsg = objIMAP4.RetrieveSingleMessage(1, False) If Not objIMAP4.IsError Then ' Display the number of ' attachments in the message Response.Write "The message contains " & _ objMsg.Attachments.Count & " attachment(s)" Else ' Display error information Response.Write "Error #" & objIMAP4.ErrCode & ", " & objIMAP4.ErrDesc End If Else ' Display error information Response.Write "Error #" & objIMAP4.ErrCode & "<br>" Response.Write "Server response: " & objIMAP4.ServerResponse End If ' Close the connection objIMAP4.Disconnect Else ' Display error information Response.Write "Error #" & objIMAP4.ErrCode & "<br>" Response.Write "Server response: " & objIMAP4.ServerResponse End If %>See Also: