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

Purpose

 

This example demonstrates the ease and flexibility of auto-forwarding messages to a different email address. There are four major actions:

 

  1. Check an email account every 5 seconds for new messages 
  2. Retrieve all messages 
  3. Forward 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 retrieve on a regular basis and forward to another email address. 

 

For example, suppose a company has a special email account for general inquiries. The handling of the incoming inquiries is done by different people (perhaps they rotate week on week or the usual person goes on vacation), this feature could be used to forward the inquiry emails to whomever is responsible to handle them for a given time period.

 

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 mail.domain.com -popuser email@domain.com -poppassword test -popforward -to email@domain.com -from email@domain.com -popserver mail.domain.com

 

pause

 

Steps

 

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

 

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

 

NOTE: Notice that we are not using the parameter -popreceive: this is because we are not actually storing the messages on the local hard drive "permanently" - they are only temporarily stored by NetMailBot for the purposes of forwarding them. -popreceive causes NetMailBot to store the messages (or their parts) in a directory of your choosing.

 

  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, it will be forwarded to the email address specified with the -to parameter.
  4. After the email message is forwarded, it will be deleted from the POP3 mail server.