Purpose
This example demonstrates how to use the email forwarding features of NetMailBot while running NetMailBot as a Windows Service.
Specifically, a POP3 user account is monitored for new messages. When new messages are found, they are forwarded to the specified recipient. After the email is forwarded, the original email messages in the POP3 user account are deleted.
Additional Prerequisites
Prepared Example Files
The archive contains six files:
File Contents
This is the content of the NMBService.ini file:
[Settings]
ServiceName = NMBService
ProcCount = 1
CheckProcess = 60
[Process0]
CommandLine = C:\Program Files\NetMailBot\netmailbot -receive -popforward -popreceive 1 -popserver localhost -popuser email@domain.com -poppassword secret -to email@domain.com -from email@domain.com -server localhost
WorkingDir = C:\Program Files\NetMailBot
PauseStart = 0
PauseEnd = 3000
UserInterface = No
Restart = No
All of the .bat files invoke NMBService.exe with various parameters to effect the desired outcome.
The contents of the .bat files are the same as in the Watch as a Service example.
Steps