Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8241669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:54:35+00:00 2026-06-07T20:54:35+00:00

I would like to know how to programatically restart IIS 6.0 SMTP server. The

  • 0

I would like to know how to programatically restart IIS 6.0 SMTP server.

The SMTP server I have setup crashes every now and then. I don’t notice it for a couple days, but that is by far way too late to do anything about it.

I want to set up a scheduled task every 30 minutes or so to test if the SMTP server is running, and if its not, the Scheduled task with automatically start it back up.

I have found a way to check if the SMTP server is up and running, but I have not figured out how to restart the process if it crashes.

That way is posted here: Testing SMTP server is running via C#

Any help would be brilliant!

Thank you.

Im developing the Console application in C# to check if its running or not, so any code examples would be great too.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:54:36+00:00Added an answer on June 7, 2026 at 8:54 pm

    A ServiceController can help you, as it has start and stop methods. Look at the sample in the msdn page.

    Another sample is taken from the ServiceControllerStatus Enumeration is nearly what you need (just replace the service name).

    ServiceController sc = new ServiceController("Telnet");
    Console.WriteLine("The Telnet service status is currently set to {0}", 
                      sc.Status.ToString());
    
    if  ((sc.Status.Equals(ServiceControllerStatus.Stopped)) ||
         (sc.Status.Equals(ServiceControllerStatus.StopPending)))
    {
       // Start the service if the current status is stopped.
    
       Console.WriteLine("Starting the Telnet service...");
       sc.Start();
    }  
    else
    {
       // Stop the service if its status is not set to "Stopped".
    
       Console.WriteLine("Stopping the Telnet service...");
       sc.Stop();
    }  
    
    // Refresh and display the current service status.
    sc.Refresh();
    Console.WriteLine("The Telnet service status is now set to {0}.", 
                       sc.Status.ToString());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know how. I have looked at this topic , and
I would like to know how to programatically click a link from with in
I would like to know whether I can use DL Query in Protege programatically.
I have a gridview and I would like to be able to programatically change
I would like to bring a column into view programatically. I have a lot
I would like to know if there is any way we can see programatically
I have a databinded checkedlistbox in one form and I would like to know
I would like to know how I can generate system wide events programatically on
Anyone know how to do this? I would like to programatically (sp?) open a
i would like know some reference. I know i can googling it. but prefer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.