'############################### '### Send a mail via Outlook ### '### ### '### (c) Dirk Pelzer 1999 ### '############################### Option Explicit Dim oOutlook Dim oNameSpace Dim oMailItem On error resume next '################################## '### Prepare Outlook and log on ### '################################## Set oOutlook = WScript.CreateObject("Outlook.Application") Set oNameSpace = oOutlook.GetNameSpace("MAPI") oNameSpace.Logon "", "", False, True '### must be replaced by ### '### the name of the actual Outlook-Profil to ### '### be used ### Set oMailItem = oOutlook.CreateItem(0) '############################# '### Compile and send mail ### '############################# oMailItem.to = "" oMailItem.cc = "" oMailItem.Subject = "My subject" oMailItem.Body = "Your text goes here" oMailItem.Send '####################################### '### Perform houskeeping and log off ### '####################################### oNameSpace.Logoff Set oOutlook = nothing Set oNameSpace = nothing Set oMailItem = nothing