关闭。这个问题是 off-topic 。它目前不接受答案。
想改善这个问题吗? Update the question 所以它是堆栈溢出的 on-topic。
8年前关闭。
Improve this question
我最近在将我的 .net 框架从 3.5 升级到 4.0 后遇到了一个问题:
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 ---
我在这里阅读了这个连接错误列表: http://connect.microsoft.com/VisualStudio/feedback/details/544562/cannot-send-e-mails-with-large-attachments-system-net-mail-smtpclient-system-net-mail-mailmessage 。
如果有人关心这个问题,请在 Connect 上投票,这样它会尽快修复。
最佳答案
该错误已被修补:https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=30226
Title: KB2183292
Release Date: 7/21/2010
Size: 8.58 MB
Version: Hotfix
Category: Build
Description QFE: System.Net.Mail - SmtpClient class throws exceptions if file attachment is > over 3MB
关于.NET 4.0 在发送附件大于 3MB 的电子邮件时失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2803132/