socket error 10061

Giganews Newsgroups
Subject: socket error 10061
Posted by:  Rhys Sage (abu…@127.0.0.1)
Date: Mon, 9 Feb 2004

What does socket error 10061 mean?

I'm using the following code:

procedure TMailControl.OpenPOP3Account;
// Loads the registry and opens the account
var
Registry : TRegistry;
RegPath : string;
begin
// Load settings from registry
RegPath := 'Software\SageWorld\AgencySpammer';
Registry := TRegistry.Create;
Registry.RootKey := HKEY_CURRENT_USER;
if Registry.KeyExists(RegPath) then
IdPOP31.Username := Registry.ReadString('POP3 User ID');
IdPOP31.Password := Registry.ReadString('POP3 Password');
IdPOP31.Host := Registry.ReadString('POP3 Server ID');
Registry.Free;
// Now Open the account
IdPOP31.Connect(10000);
if not IdPOP31.Connected then
  begin
      MessageDlg('Connection failed!' + #13 + 'Check email account
settings.', mtError,[mbOk], 0);
  end;
end;

procedure TMailControl.GetPOP3Headers;
var MyCount,BoxSize: Integer;
begin
BoxSize := IdPOP31.RetrieveMailBoxSize;
for MyCount := 1 to BoxSize do
  begin
  IdMessage1.Clear;
  IdPOP31.RetrieveHeader(MyCount,IdMessage1);
  ListBox1.Items.Add(IntToStr(MyCount) + '::' + IdMessage1.From.Text +
      ' - ' + IdMessage1.Subject);
  end;
//
end;

procedure TMailControl.ClosePOP3Account;
begin
IdPOP31.Disconnect;
end;

procedure TMailControl.Loadheaders1Click(Sender: TObject);
begin
OpenPOP3Account;
GetPOP3Headers;
ClosePOP3Account;
end;

--
Yours

Rhys

Join the anti-spam project:
http://groups.yahoo.com/group/Anti-Spam-Development/
or view my website:
http://www.sageworld.freeserve.co.uk

"Linux - an operating system that wants to work.
Windows - an operating system that mostly works.
Mac OS - an operating system that really works."

Replies