You can use the Outlook Application object to send email. In the example below, you can create a function (or remove the function wrapper if you want to email directly in the script instead of from a function library). Also, there are two examples provided below the function definition that show how to use the function.
Function SendMail(SendTo, Subject, Body, Attachment)
Set ol=CreateObject(''Outlook.Application'')
Set Mail=ol.CreateItem(0)
Mail.to=SendTo
Mail.Subject=Subject
Mail.Body=Body
If (Attachment <> '''') Then
Mail.Attachments.Add(Attachment)
End If
Mail.Send
ol.Quit
Set Mail = Nothing
Set ol = Nothing
End Function
Function call without an attachment:
SendMail (''test@test.com'', ''This is the subject'', ''Here is some email text'','''')
Function call with an attachment:
SendMail (''test@test.com'', ''This is the subject'', ''Here is some email text'',''C:Documentsscreenshot.jpg'')