home *** CD-ROM | disk | FTP | other *** search
- /*
- ** DELETE.C [edit EMAIL.H before compiling]
- **
- ** This program deletes the specified email
- ** message on the SMTP server.
- */
-
- #include <windows.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include "see.h"
- #include "email.h"
-
- static char Buffer[512];
-
- void ErrorExit(int Code)
- {seeErrorText(Code,(LPSTR)Buffer,512);
- printf("SEE Error %d: %s\n", Code, Buffer);
- seeClose();
- exit(1);
- }
-
- void main(int argc, char *argv[])
- {int Code;
- int MsgNbr;
- if(argc!=2)
- {printf("Usage: DELETE <MsgNbr>\n");
- exit(1);
- }
- MsgNbr = atoi(argv[1]);
- if((MsgNbr<1)||(MsgNbr>1000))
- {printf("MsgNbr = %d out of range\n", MsgNbr);
- exit(1);
- }
- /* define diagnostics log file */
- ///seeStringParam(SEE_LOG_FILE, (LPSTR)"delete.log");
- /* connect to POP3 server */
- puts("Connecting...");
- Code = seePop3Connect(
- (LPSTR)POP3_HOST_NAME,
- (LPSTR)POP3_USER_NAME,
- (LPSTR)POP3_PASSWORD);
- if(Code<0) ErrorExit(Code);
- /* delete message */
- printf("Deleting message %d...\n",MsgNbr);
- Code = seeDeleteEmail(MsgNbr);
- if(Code<0) ErrorExit(Code);
- seeClose();
- } /* end main */
-
-
-