Keep IIS SMTP Windows Service running 24/7 with Service Protector

How to Keep the IIS SMTP Windows Service Running 24/7 with Service Protector

Automatically re-launch your site's SMTP server when it stops for any reason. Survive crashes, memory leaks, accidental shutdowns, etc.

IIS 6 and IIS 7 rely on the SMTP Service to deliver email messages from web sites. It is installed as a Windows Service, and is designed to run unattended in the background in a 24x7 environment:

To protect the SMTP Windows Service with Service Protector:

  1. Download and install Service Protector, if necessary.

  2. Start Service Protector.

  3. Select Protector > Add to open the Add Protector window:

    Add Protector

  4. On the General tab, in the Service to protect field, choose the SMTP windows service. It will be called Simple Mail Transfer Protocol (SMTP).

    (The green circle next to the name means that the service is already running...)

    SMTP Windows Service: General Tab

  5. If you find that your SMTP server occasionally crashes or hangs up after prolonged use, we recommend restarting the service daily at a "quiet time". To do so:

    • Switch to the Monitor tab.
    • Check the At the following times box.
    • Click the Add... button to summon the dialog.
    • Specify a good time to restart the service, which should only take a few seconds. Every day at 3 AM works for us. (Note that you can choose to reboot the entire PC at that time if that is appropriate for your situation.)
    • Click the OK button to record your time.

    SMTP Windows Service: Monitor Tab

  6. Click the Save button. In a few seconds, an entry for the SMTP service will show up in the Service Protector window. The service may already be running but it is not yet being monitored and protected by Service Protector.

    SMTP Windows Service: Created

    Click on the green circle to see details of the SMTP service:

    SMTP Windows Service: Details

  7. To start monitoring the SMTP service, choose Protector > Start "Simple Mail Transfer Protocol (SMTP)". In a couple of seconds the shield icon in the Protected column will turn green to show that the service is being managed by Service Protector:

    SMTP Windows Service: Protected

    Click on that green shield to find out when monitoring started:

    SMTP Windows Service: Details

  8. That's it! Next time your computer boots, the IIS SMTP service will start up automatically (as normal) and Service Protector will start monitoring the service to restart it quickly it if it crashes for any reason.

    We encourage you to edit the SMTP entry in Service Protector and check out the many other settings that may be helpful in your environment. For example, send email when the service fails, automatically restart if the service gets "stuck", and much more.



Trouble protecting the SMTP Windows Service?