Sage EmailManager - error while setting eMail.body value

This question is not answered

Excepion: jscript error: [SafeCall Exception]: List index out of bounds (0) Line: 270 Char: 1

Three weeks ago we upgraded our SCRM to the latest Version 2018.R2.
And since forever we are using the Sage EmailManager to send replys to our Customers, that a Ticket has been created.
But about 2 weeks ago the Manager throws an exception in both of our emailscripts, always when we try to set the value of eMail.Body.

For Example:

var templateBody = "My Email Body Text.";
eMail.Body = templateBody;


eMail.Body = "My Email Body Text.";

If we remove this line and try sending the Email without writing something into the email.Body.
It works like a charm.

I've gone up and down through the script but i can't manage to find the problem.

Some ideas to that?

All Replies
  • DNellesen, are you still having this issue?  I just upgraded a client to 2018 R2 over the weekend and now they are getting the same error message when sending out emails through the emailManager.  I would love to know what you did to fix it :-)  Thanks in advance.

  • Hi Brad, we never realy did.

    I've implemented a workaround where I created an SQL-Server function and called it within the emailManager.

    function ISBSendMail(pProfile, pRecipients, pSubject, pBody, pSender)


     var DBMailSQL = "EXEC msdb.dbo.sp_send_dbmail "+

                     "@recipients='"+pRecipients+"', "+

                     "@subject = '"+pSubject+"', "+

                     "@body = '"+pBody.replace(/\n|\r/g, "")+"', "+

                     "@body_format = 'HTML' , "+

                     "@profile_name = '"+pProfile+"', " +

                     "@from_address = '"+pSender+"'; ";

    MsgHandler.Log("DN LOG - "+DBMailSQL);

     var DBMailQuery = eWare.CreateQueryObj(DBMailSQL);