Check an Account every 5 seconds,
Retrieve Messages, Forward, Then Delete

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. 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, you can use this feature to monitor an email account and forward all email to another email address.

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

  • Example Download
    A working example can be downloaded, so that you can follow along with the example:
     Click Here (forward.zip < 1 KB)
    The downloadable example is a zip file that contains one file:
    • forward.bat - The batch file that will instruct NetMailBot to perform the desired actions.

    Instructions for Download and Installation

    • Download the example zip file and save it to your hard drive
    • Create a directory on your C drive named "tmp"
    • Unzip all of the files in the example zip file into the newly created directory c:\tmp.

  • Key parameter(s) used

  • Steps
    1. Open Notepad and edit the batch file retrieve.bat. Change the values of the parameters:
      • -popuser to your own user account.
      • -poppassword to the user account's password.
      • -popserver to the user account's POP3 mail server.
      • -to to another email address.
      • -from to another email address.
      • -server to an SMTP mail server to send the email through.
    2. NOTE: The parameter -receive is required whenever using the POP3 parameters.
    3. Execute the batch file by double-clicking it in "My Computer".
    4. An email message from your POP3 mail server should be downloaded and the message parts should be saved to your hard drive.

      The message parts are saved in files in a folder named "pop" under your system temporary directory.

      To view these files, using Windows Explorer, navigate to your system temporary directory, then to the sub-directory "pop"

    5. After the email message is downloaded, it will be forwarded to the email address specified with the -to parameter.
    6. After the email message is forwarded, it will be deleted from the POP3 mail server.