Search The ForumSearch   RegisterRegister  LoginLogin

MailBee POP3

 AfterLogic Forum : MailBee POP3
Subject Topic: [Error: Already connected] Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Guests
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 08 March 2005 at 7:46pm | IP Logged Quote Guests


I get the error '[Error: Already connected]' when using this code copied from your FAQ, any suggestions ? Thanks.

Dim Mailer, Msg, Msgs
Set Mailer = CreateObject("MailBee.POP3")
Mailer.LicenseKey = "<my key>"
Mailer.Connect HOST, PORT, USERNAME, PASSWORD
If Mailer.Connect Then
   Set Msgs = Mailer.RetrieveHeaders
   Response.Write Msgs.Count & " messages total in mailbox<br>"
   For Each Msg In Msgs
      Response.Write "Subject: " & Msg.Subject & "<br>"
   Next
   Mailer.Disconnect
Else
   Response.Write Mailer.ErrDesc
End If         &nbs p;
Back to Top View Guests's Profile Search for other posts by Guests
 
Guests
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 08 March 2005 at 7:53pm | IP Logged Quote Guests

Also it works if I remove the IF THEN check ...


           Dim Mailer, Msg, Msgs
           Set Mailer = CreateObject("MailBee.POP3")
           Mailer.LicenseKey = "MBC500-A4ACD4E493-E90B0116BB66090F8B4DC2360EC1027C" &n bsp;   
           Mailer.Connect HOST, PORT, USERNAME, PASSWORD        &nbs p; 
           'If Mailer.Connect Then
               Set Msgs = Mailer.RetrieveHeaders
              Response.Write "Total of " & Msgs.Count & " messages are avialable on the server.<br>"
              For Each Msg In Msgs
                  Response.Write "Subject: " & Msg.Subject & "<br>"
              Next
              Mailer.Disconnect
           'Else
           ' Response.Write Mailer.ErrDesc
           'End If         &nbs p;
Back to Top View Guests's Profile Search for other posts by Guests
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 09 March 2005 at 7:45am | IP Logged Quote Alex

In your code call to Connect method is made twice - this caused an error. If you open FAQ once again, you can see the following syntax is used:

Mailer.Connect ...
If Mailer.Connected Then
...

Connected is a property while Connect is a method.

Or, you can use one line instead of two:

If Mailer.Connect(...) Then

Anyway, only one call to Connect method is allowed.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide