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

  • Home
  • SEARCH
  • 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 6201839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:37:37+00:00 2026-05-24T04:37:37+00:00

Looking for a simple script that would run on windows 2003 server that would

  • 0

Looking for a simple script that would run on windows 2003 server that would basically send me an email. What I plan to do us the windows services auto recovery manager to trigger the script.

I did find a reference to how I can trigger the use of this script: How to monitor Windows services

But I need some help on writing an send email script that would work for windows platform. I’m not sure what language would be best for this. thanks.

  • 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-05-24T04:37:38+00:00Added an answer on May 24, 2026 at 4:37 am

    One simple way would be to use javascript (or VBscript). If you google for “Server.CreateObject(“CDO.Message”)” you will find more examples.

    Put the code below in a file with extension: “.js”, for example email.js
    To call use “cscript email.js” on the command line. Replace server name and emails with valid values.

    Windows 2003 should have CDO installed. The script used to work on windows XP and server 2003. This example uses smtp server over the network but there are other options too.

    Powershell is probably available for server 2003 .. so it could be another option.
    ============================== code ==============================

    function sendMail ( strFrom, strTo, strSubject, strMessage ) {
    try {
    objMail = Server.CreateObject(“CDO.Message”);
    objConfig = Server.CreateObject(“CDO.Configuration”);
    objFields = objConfig.Fields;

        with (objFields) {          
    

    Item(“http://schemas.microsoft.com/cdo/configuration/sendusing”)= 2;
    Item(“http://schemas.microsoft.com/cdo/configuration/smtpserver”)= “xxxxsmtp.xxxserver.xxorg”;
    Item(“http://schemas.microsoft.com/cdo/configuration/smtpserverport”)= 25;
    Item(“http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout”) = 30;
    Update();
    }
    with (objMail) {
    Configuration = objConfig;
    To = strTo; //”\”User\” ,”\”AnotherUser\” ;”
    From = strFrom;
    Subject = strSubject;
    TextBody = strMessage;
    //if we need to send an attachement

        //AddAttachment("D:\\test.doc");
            Send();
        }           
    }
    catch(e) {
    WScript.Echo(e.message);
        return false;
    }   
    delete objFields;
    delete objConfig;
    delete objMail;   
    return true;
    

    }

    //WScript.Echo(‘qqq’);

    sendMail( ‘from@xxxxxx.com’, ‘to@yyy.com’ , ‘test’, ‘msg’);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a simple C# script that will export an SVN folder. note:
I am looking for information on how to create and run a simple server
Using Windows 2003, I'm look for a way to create a logoff script that
Im looking for a simple bit of code that will let me add the
I am looking for a simple JavaScript example that updates DOM. Any suggestions?
I am looking for a simple web load-testing tool that has a GUI. I
I have a user script that would be much more useful if it could
I am looking for a PHP script that will simply display xxx subscribers who
I have a really trivial perl script that I would like to distribute to
I am looking into implementing a simple crash report on my application that will

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.