Winscripter
  WSH
  Forums
  Downloads
  Books
  Links
  Amazon




Login
Register

© winscripter.com
1998-2004







Script: CDO Send Email

Posted by on Sunday, January 25, 2004 (PST)

Script: Example using CDO.Message to send a text email.
SendTextEMail( "test@test.com", "you@test.com", "Subject", "This is the body" ); 
function SendTextEMail( from, to, subject, body )
{
  try
  {
   var cdo = new ActiveXObject( "CDO.Message" );
   cdo.From     = from;
   cdo.To       = to;
   cdo.Subject  = subject;
   cdo.TextBody = body;
   cdo.Send(); 
  }
  catch( e )
  {
   WScript.Echo( "Error: " + e.description );
  }
}



WSH and ADSI Administrative Scripting

New Articles
  • List installed COM objects and associated ProgIDs
    Script: Lists all COM Objects and their associated ProgIDs (If available). Win32_ClassicCOMClassSetting

  • Script: File Rotator
    Script: Rotate files where the most current file has the lowest number in the archive. When files exceed the retention period, they are deleted. Typically used for log files, backups, etc..

  • Script: Create IIS Website and DNS record
    Script: Dan Casier sent me this script that will create a website and appropriate DNS record. The script is intended for Windows 2000 Server with local DNS and necessary DNS mof installed.


  • Winscripter   |  WSH   |  Forums   |  Downloads   |  Books   |  Links   |  Amazon