.NET 4.0 Fails When sending emails with attachments larger than 3MB

Posted by JL on Stack Overflow See other posts from Stack Overflow or by JL
Published on 2010-05-10T13:57:51Z Indexed on 2010/05/10 14:04 UTC
Read the original article Hit count: 352

Filed under:
|
|

I recently had an issue after upgrading my .net framework to 4.0 from 3.5:

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.Message.Send(BaseWriter writer, Boolean sendEnvelope) at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace ---

I read this connect bug listing here: http://connect.microsoft.com/VisualStudio/feedback/details/544562/cannot-send-e-mails-with-large-attachments-system-net-mail-smtpclient-system-net-mail-mailmessage.

If anyone cares about this issue, please vote for it on Connect, so it will be fixed sooner.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about .net-4.0