wsInetTools

Description COM dll written in C++ that allows you to easily send email and download web pages.
Current Version 0.3 Beta - Download (26K zip file)
Release Date 17 Dec 2000
Author Daren Thiel
Web Site www.winscripter.com


Whats New


License Agreement

Agreement

This program is free for use by individuals and non-profit
organizations.  This program may be redistributed only if
full credit is given to the author and the inclusion of 
this file unaltered.  It may not be used in or with a 
product released for commerical distribution.

Disclaimer of Warranty

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE RELEASE 
"AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OR 
MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED 
OR IMPLIED.  NO WARRANTY OF FITNESS FOR A PARTICULAR 
PURPOSE IS OFFERED.

Good data processing procedure dictates that any program be
thoroughly tested with non-critical data before relying on 
it. The user must assume the entire risk of using the 
program. THE AUTHOR ASSUMES NO LIABILITY FOR USE OF THIS
PRODUCT.


Description


wsInetTools is a COM dll written in C++, that allows to:


Installation


  1. Copy wsInetTools.dll to %windir%\system32 directory
  2. Run regsvr32 to register the dll with the system.

  3. wsInetTools is ready for use.


Usage


Using wsInetTools from Windows Script Host is straight forward and was specifically written for scripters. It can be used by any language or environment that can instantiate COM objects. This includes, but not limited to the following:

wsInetTools contains two creatable objects, SMTP and HTTP. In your code, you must first create an instance of the desired object, assuming wsInetTools is registered on the system.

Using the exposed properties and methods, you can send basic email and download text based documents from the web. Refer the the samples below.

SMTP - API

ProgID: wsInetTools.SMTP
Properties: MailServer
MailPort
LastError
Methods: SendMail( from, to, subject, body )



SMTP - Example

// Define variables
var smtp, to, from, subject, body;      
           
// Instantiate COM object 
mail = new ActiveXObject( "wsInetTools.SMTP" );  

// Enter you mail server 
mail.MailServer = "smtp.yourdomain.com";      
         
// Set email properties       
from    = "youremail@yourdomain.com";
to      = "recipient@somedomain.com";              
subject = "Testing wsInetTools";                  
body    = "This is just a test message\r\n";    
  
// Send the mail
mail.SendMail(  from, to, subject, body );    




HTTP - API

ProgID: wsInetTools.HTTP
Properties: LastError
Methods: GetWebPage( URL )
GetBinary( remoteFile, localFile )



HTTP - Text Example


// Define variables
var web, file, url;               
                 
// URL of the page want to download
url  = "http://www.winscripter.com/content.html";  

// Instantiate the COM object
web  = new ActiveXObject( "wsInetTools.HTTP" );  
  
// Download the page and store in variable 'file'
file = web.GetWebPage( url );   


HTTP - Binary Example


// Instantiate the COM object
var web = new ActiveXObject( "wsInetTools.HTTP" );

// Define the full path to local and remote files
var remoteBinaryFile = "http://www.winscript.com/ads/ad1.gif"
var localBinaryFile  = "e:\\ad1.gif";

// Call GetBinary
web.GetBinary( remoteBinaryFile, localBinaryFile ); 


Known Issues and Future enhancements


Applies to all

SMTP



HTTP

© 2000 WinScripter - winscripter.com