Delphi DLL
Delphi DLL
Send a POP3 NOOP Command
See more POP3 Examples
Demonstrates the Chilkat MailMan.Pop3Noop method, which sends a POP3 NOOP command to the server. NOOP does nothing except elicit a positive response, which is useful for keeping a session alive or verifying the connection is still responsive. This example begins a POP3 session and sends a NOOP.
Background:
NOOP ("no operation") is a standard keep-alive across many internet protocols. Servers often drop idle connections after a timeout; sending a periodic NOOP resets that timer so a long-running session stays open. It also serves as a cheap "are you still there?" probe — a successful reply confirms the socket and the authenticated session are still healthy.Chilkat Delphi DLL Downloads
var
success: Boolean;
mailman: HCkMailMan;
begin
success := False;
// Demonstrates the MailMan.Pop3Noop method, which sends a POP3 NOOP command to the server.
// NOOP does nothing except elicit a positive response, which is useful for keeping a
// session alive or verifying the connection is still responsive.
mailman := CkMailMan_Create();
// Configure the POP3 server connection.
CkMailMan_putMailHost(mailman,'pop.example.com');
CkMailMan_putMailPort(mailman,995);
CkMailMan_putPopSsl(mailman,True);
CkMailMan_putPopUsername(mailman,'user@example.com');
CkMailMan_putPopPassword(mailman,'myPassword');
// Begin a POP3 session.
success := CkMailMan_Pop3BeginSession(mailman);
if (success = False) then
begin
Memo1.Lines.Add(CkMailMan__lastErrorText(mailman));
Exit;
end;
// Send a NOOP to keep the session alive.
success := CkMailMan_Pop3Noop(mailman);
if (success = False) then
begin
Memo1.Lines.Add(CkMailMan__lastErrorText(mailman));
Exit;
end;
Memo1.Lines.Add('POP3 NOOP succeeded.');
CkMailMan_Dispose(mailman);