'-------------------------------------------------------------------------- ' TestMapi.vbs ' Demo on how to send a email with a script '-------------------------------------------------------------------------- Option Explicit app.cleartrace Dim objSession, objMessage, objOneRecip 'Set objSession = CreateObject("MAPI.Session") ' create a session then log on, supplying username and password Set objSession = CreateObject("MAPI.Session") ' change the parameters to valid values for your configuration objSession.Logon 'profileName:="Jane Doe", _ 'profilePassword:="my_pword" ' create a message and fill in its properties Set objMessage = objSession.Outbox.Messages.Add objMessage.Subject = "Sample Message" objMessage.Text = "This is some sample message text." ' create the recipient Set objOneRecip = objMessage.Recipients.Add objOneRecip.Name = "support@myalbumpro.com" 'objOneRecip.Type = CdoTo objOneRecip.Resolve ' send the message and log off objMessage.Update objMessage.Send False, False app.Trace "The message has been sent" objSession.Logoff app.Trace "Done !"