MSN Home  |  My MSN  |  Hotmail
Sign in to Windows Live ID Web Search:   
go to MSNGroups 
Groups Home  |  My Groups  |  Language  |  Help  
 
Windows-Scriptwindowsscript@groups.msn.com 
  
What's New
  Join Now
  Home  
  Windows XP  
  Getting Started  
  Advanced Stuff  
  
  Code Signing  
  
  RunDLL  
  
  Script Encoder  
  
  Shell.Application  
  
  Managing IIS  
  
  SMTP Event Sync  
  
  WMI Tutorial  
  
  WMI Information Series  
  
  MSI Files  
  
  Installing Apps  
  FAQ  
  Downloads  
  Recommendations  
  MS Newsgroups  
  Upload  
  Old Homes  
  
  
  Tools  
 
   

W2K includes and SMTP mail server as an optional component of Internet services. You can register VBScript files to process SMTP server events such as a new mail arriving. The script gets full access to the contents of the message and the header information.

Before trying to use the process I about to describe you should ensure that your SMTP server is configured and able to receive email which should be located in the xxx directory. You can use Outlook Express on the SMTP server to create email messages by creating a mail account that uses 127.0.0.1 as the SMTP and POP address (even though the server doesn't support POP, OE requires that you enter something).

Event scripts are saved as .vbs files just like WSH but they must contain the script language block tags

language=VBScript>
Sub ISMTPOnArrival_OnArrival( ByVal Msg, Status)
  ' sink code here
End Sub
</SCRIPT>

Microsoft provides a WSH script to register for SMTP events which I have included in the download section.
Command to register your script...

cscript smtpreg.vbs /add     1 onarrival SMTPScriptingHost CDO.SS_SMTPOnArrivalSink "mail from=*"
cscript smtpreg.vbs /setprop 1 onarrival SMTPScriptingHost Sink ScriptName "c:\path\to\sinkscript.vbs" 

I have also included a sample script that will log information on each message received to a text file.
You can find more information on MSDN.

 
Notice: Microsoft has no responsibility for the content featured in this group. Click here for more info.
  Try MSN Internet Software for FREE!
    MSN Home  |  My MSN  |  Hotmail  |  Search
Feedback  |  Help  
  ©2005 Microsoft Corporation. All rights reserved.  Legal  Advertise  MSN Privacy