hMailServer 4.0 and later enable you to write your own scripts to extend the server's functionality. Support
for Microsoft VBScript and Microsoft JScript currently exists in the server. You will find at hMailServer.com useful sample scripts written in VBScript. For general script syntax, you should consult the Microsoft MSDN
All hMailServer scripts should be placed in a file called EventHandlers.vbs. The
file is found in the hMailServer Events directory, normally C:Program FileshMailServerEvents.
hMailServer offers the following pre-defined events:
Follow these steps to enable scripting:
- Start hMailAdmin
- If you're using hMailServer 4.0, navigate to Settings->Scripting. If you're using 4.1 or later, navigate to Settings->Advanced->Scripting
- Select Active
- Click on Save to save your changes
Whenever you modify the script file you have to click on Reload script for hMailServer to refresh, recording the changes. hMailServer keeps a copy of the entire script in memory, which improves performance.