We ad a requirement where in if the To recipient ids some email lets A@gmail.com we need to replace with B@gmail.com when email arrives at crm.For this reason we wrote a plugin which does this job.The problem in the plugin is if Torecepients is coming as more than 20 recepients then its not creating email message.Also no errors are stored in tracing.This plugin which sends email is written in preopreation create until 20 recepients it works if there more than 20 recpeints then email message is not getting created.
If I keep trace before the target.torecepients where im assigning the recipients in the plugin the trace is appearing.For example below is the code snippet.
if (!isEmailFound)
{
updatedToRecepients.Append(addressUsed).Append(";");
}
Tracing.trace($"updatedToRecepients before"+ updatedToRecepients.ToString());
target.ToRecipients = updatedToRecepients.ToString();
Tracing.trace($"after" + updatedToRecepients.ToString());
if there are more than 21 recepients then bfore and after are getting traced with the 21 recepients or more than 21 recpients but the email message is not getting created.For 20 recpients email messages are gettingcreated.Any ideas why email message is not created for more than 20 reciepients ?