Hi Jeff, I have a js script that sends emails on a scheduled task. It was working fine in older version on old server.
Now I have migrated everything to a new server (Server 2012 R2 Standard 64 bit) and upgraded to 7.3 SP2.1.
The email send script is no longer working.
I tried taking your example below and stripping it down to run as a stand-alone js script, but it is not working either.
Here is what I have -
var username = "test";
var password = "test";
var CRM = new ActiveXObject("eWare.CRM");
CRM.FastLogon = 3; //this prevents the meta data from loading.
CRM.Logon(username,password);
var myMailObject = CRM.GetBlock("messageblock");
with (myMailObject)
{
DisplayForm = false;
mSubject = "Subject Here 2";
mBody = "Message Goes here";
mShowCC = false;
mShowBCC = false;
AddRecipient("test@test.com","test@test.com","TO");
}
myMailObject.Execute();
I have this script in a file called emailtest.js and I launch it like this -
C:\WINDOWS\SysWOW64\wscript.exe emailtest.js
The logs show errors referencing impersonated user, but I have checked those settings and they look correct.
Jul 25 2016 9:46:12.602 1592 4532 1 startup,version,dllsize,dlldate,exehost,imagebase,reference Sage CRM 7.3 SP2.1 11630080 May 18 2016 8:44:38.000 C:\WINDOWS\SysWOW64\wscript.exe 1A8C8A50 #line#
Jul 25 2016 9:46:15.556 1592 4532 1 Metadata 2843
Jul 25 2016 9:46:15.634 1592 4532 5 LoadUserSession: RemoteAddress not found
Jul 25 2016 9:46:15.556 1592 4532 1 Metadata 2843
Jul 25 2016 9:46:15.634 1592 4532 5 LoadUserSession: RemoteAddress not found
Jul 25 2016 9:46:15.649 1592 4532 1 PrepImpersonatefail,Error OpenThreadToken failed<br />An attempt was made to reference a token that does not exist<br />
Jul 25 2016 9:46:15.649 1592 4532 1 ** Created global user activity thread **
Jul 25 2016 9:46:15.649 1592 9208 1 ImpersonateThread.Impersonate,Error ImpersonateLoggedOnUser failed<br />The handle is invalid<br />
Jul 25 2016 9:46:15.806 1592 4532 3 CoeWareBase,Time 3203
Jul 25 2016 9:46:15.806 1592 4532 1 shutdown
Currently impersonated user is domain admin.
Any suggestions?
Thanks,
Kevin.