Hi I have my vbs script below to send email by executing xp_sendmail.
ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=myserver"
Set dbconn = CreateObject("ADODB.Connection")
dbconn.Open ConnectionString
DIM cmd
SET cmd = CreateObject("ADODB.Command")
SET cmd.ActiveConnection = dbconn
cmd.CommandText = "xp_sendmail"
cmd.CommandType = 4 'adCmdStoredProc
Dim email = "me@me.com"
Dim subj = "test"
Dim msg = "message"
cmd.Parameters("@Recipients") = email
cmd.Parameters("@Subject") = subj
cmd.Parameters("@message") = msg
cmd.Execute
This gives an error on the line:
Dim email = "me@me.com"
Error: Expected end of element. Any help would be appreciated.