Check Every 5s, Retrieve, Reply, then Delete
Previous Topic  Next Topic 



This example demonstrates the ease and flexibility of auto-replying to messages. There are four major actions:


  1. Check an email account every 5 seconds for new messages 
  2. Retrieve all messages 
  3. Reply to all messages 
  4. Delete all messages


** WARNING ** This example will delete all emails 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.


Why Use this Feature?


This feature is useful for monitoring a POP3 email account for new email messages that you wish to auto-reply to.


For example, suppose a company has a special email account for support inquiries. The handling of the incoming support requests is done by different people who are assigned the cases based upon their current workload. The emails are stored on the local hard drive by NetMailBot (to be handed out to the support staff) but in order to let the customer sending the inquiry know that it has been received, this feature could be used to auto-reply to the inquiry emails in a timely fashion. Perhaps the auto-reply mail would just acknowledge the request and would tell the sender to expect a response from a support staff member within some agreed timeframe.


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 -receive -popwatch -popwatchwait 5000 -popdelete -server -popuser -poppassword test -popreply -from -body "Thanks!" -popserver






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


NOTE: The parameter -receive is required whenever using the POP3 parameters.


NOTE: Note that absence of the -to parameter. Aren't we sending an email when we reply to an email? Normally, -to is always required in NetMailBot when we are sending email, but this is the exception: when using -popreply, the "To:" field of the reply message is automatically set to the email address that the original email was "From:". For example, sends an email to, and the latter uses NetMailBot to automatically reply to such information inquiries. NetMailBot will assume that the reply in this case should be "To:"


  1. Invoke the batch file by double-clicking the icon or straight from the command line.
  2. An email message from your POP3 mail server should be downloaded and the message parts should be saved to your hard drive in a folder named "pop" under your System Temporary Directory.
  3. After the email message is downloaded, a reply will be sent with the simple message body of "Thanks!".
  4. After the email message is replied to, it will be deleted from the POP3 mail server.