E-mail Router – An error occurred while processing the outgoing e-mail

I recently encountered an error with the Dynamics CRM 2011 E-mail Router where outgoing e-mail messages were stuck in a Pending state. The Event Viewer and E-mail Router trace file logged the following error:

03/05/2013 07:57:12 : #61042 – An error occurred while processing the outgoing e-mail message with subject “Some Photos” for SMTP: http://localhost:5555/crm for delivery through mail.roscode.com. System.Net.Mail.SmtpException: Failure sending mail. —> System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Net.Base64Stream.EncodeBytes(Byte[] buffer, Int32 offset, Int32 count, Boolean dontDeferFinalBytes, Boolean shouldAppendSpaceToCRLF)
at System.Net.Base64Stream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Mime.MimePart.Send(BaseWriter writer)
at System.Net.Mime.MimeMultiPart.Send(BaseWriter writer)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
— End of inner exception stack trace —
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.Run()

I noticed that this error only occurs when the E-mail Router tries to send an e-mail which contains attachments. It turns out that this error is due to a bug with the .NET Framework where the System.Net.Mail.SmtpClient crashes when attempting to send e-mail messages with attachments larger than 3MB.

Microsoft has released a hotfix which you need to install on the server where the E-mail Router is installed. The hotfix can be found at http://support.microsoft.com/kb/2183292

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s