Delete an Email
Previous Topic  Next Topic 

Purpose

 

This example demonstrates how to delete an email on a POP3 email server; the mails are not automatically deleted from the server when you use -popreceive; they must be explicitly deleted with -popdelete.

 

** WARNING ** This example will delete an email for the specified user account on the specified POP3 email server. You should use a test account for this example to ensure that critical data is not accidentally deleted. 

 

Additional Prerequisites

 

The user account you specify should have at least one email message on the POP server in order for this example to work. An email can be sent to the account you specify with a different example, click here.

 

Prepared Example Files

 

 

The archive contains one file:

 

 

Batch File Contents

 

This is the content of the batch file:

 

NetMailBot.exe -receive -popdelete 1 -popserver localhost -popuser email@domain.com -poppassword secret

 

pause

 

Steps

 

  1. Unzip the DeleteAnEmail.zip file. This will produce a directory called "DeleteAnEmail". Open this directory.
  2. Open Notepad and edit the batch file "DeleteAnEmail.bat". Change the values of the following parameters:

 

NOTE: The parameter -receive is required whenever using the POP3 parameters; this parameter puts NetMailBot into what might be called "POP3 mode" as opposed to "SMTP mode" which is for sending mails.

 

  1. Invoke the batch file by double-clicking the icon or straight from the command line.
  2. NetMailBot should display that the message was deleted.