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.
Prepared Example Files
The archive contains six files:
This is the content of the NMBService.ini file:
ServiceName = NMBService
ProcCount = 1
CheckProcess = 60
CommandLine = C:\Program Files\NetMailBot\netmailbot -receive -popforward -popreceive 1 -popserver localhost -popuser firstname.lastname@example.org -poppassword secret -to email@example.com -from firstname.lastname@example.org -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.