The monthly renewal emails not sent from Creatio CRM.
The 'Email' step in the process library fails with the below error.
Microsoft.Exchange.WebServices.Data.ServiceRequestException: The request failed. The remote server returned an error: (401) Unauthorized. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
Code used in the business process :
---------------------------------------------------
var invoiceId = Get("CreatedInvoiceId");
var userConnection = Get("UserConnection");
//Terrasoft.Configuration.AimCreateMonthlyInvoiceJob.SendEmail(context.UserConnection, invId);
Terrasoft.Configuration.AimCreateMonthlyInvoiceJob.SendEmail(userConnection, invoiceId);
return true;