Here's what the script does,
When a user logs off the script a Var is created with the users daily report activities. This report is assigned to Var "MyVar" in the example. I want the script to send the var with it's information. However, the email reads "%MyVar%"
not the information in the var.
Code: Select all
MyVar = MyVar
MyVar := "JAMES"
SendGmail("Test %myVar%","[email protected]")
ExitApp
SendGmail(message,emailto){
pmsg := ComObjCreate("CDO.Message")
pmsg.From := """[VI Services]"" <[email protected]>"
pmsg.To := emailto
pmsg.Subject := ""
pmsg.TextBody := message
fields := Object()
fields.smtpserver := "smtp.gmail.com"
fields.smtpserverport := 465
fields.smtpusessl := True
fields.sendusing := 2
fields.smtpauthenticate := 1
fields.sendusername := "[email protected]"
fields.sendpassword := "password6"
fields.smtpconnectiontimeout := 60
schema := "http://schemas.microsoft.com/cdo/configuration/"
pfld := pmsg.Configuration.Fields
For field,value in fields
pfld.Item(schema . field) := value
pfld.Update()
pmsg.Send()
pmg.Close
}