WebPopDele Function

Action

Marks the mail with number nMsg as deleted.

Include file

WebAPI.bdh

Syntax

WebPopDele( in hPop : number, 
            in nMsg : number ): boolean;

Return value

  • true if the response was successfully received and the server confirmed with "+OK"

  • false otherwise

Parameter Description
hPop Handle to a Web connection that was created by WebPopConnect
nMsg Number of the message to delete

Example

dcltrans 
  transaction TWebPop3 
  const
    USERNAME := "username";
    PASSWORD := "password"; 
  var
    hPop, nMessages, nSize: number; 
  begin
    WebPopConnect(hPop, "standardhost", WEB_PORT_POP3);

     // try to log in using secure MD5 encryption 
    if not WebPopApop(hPop, USERNAME, PASSWORD) then

       // if APOP fails, try normal user/pass sequence 
      if not WebPopUser(hPop, USERNAME) or 
        not WebPopPass(hPop, PASSWORD) then
        WebPopShutdown(hPop); 
        return 1; 
      end; 
    end;

    // retrieve mail status information
    WebPopStat(hPop, nMessages, nSize);
    WebPopList(hPop, IGNORE);

    // retrieve and delete all messages 
    while nMessages > 0 do
      WebPopRetr(hPop, nMessages); 
      WebPopDele(hPop, nMessages);
      nMessages := nMessages - 1; 
    end;

    // try to delete msg 123456789 - an error msg will occur 
    WebPopDele(hPop, 123456789);

    // roll back the delete command (no msgs will be deleted)
    WebPopRset(hPop);

    // commit pop transaction 
    // (usually marked messages will be deleted) 
    // There is nothing to delete due to the pop transaction 
    // reset - WebPopRset
    WebPopQuit(hPop);
    WebPopShutdown(hPop);
  end TWebPop3;

SilkEssential sample

eMail.sep