發送附件大於 3MB 的電子郵件時,.NET 4.0 失敗 [關閉]
在將 .net 框架從 3.5 升級到 4.0 後,我最近遇到了一個問題:
System.Net.Mail.SmtpException:發送郵件失敗。—> System.IndexOutOfRangeException:索引超出了數組的範圍。在 System.Net.Base64Stream.EncodeBytes(Byte[] buffer, Int32 offset, Int32 count, Boolean dontDeferFinalBytes, Boolean shouldAppendSpaceToCRLF) 在 System.Net.Base64Stream.Write(Byte[] buffer, Int32 offset, Int32 count) 在 System.Net .Mime.MimePart.Send(BaseWriter writer) 在 System.Net.Mime.MimeMultiPart.Send(BaseWriter writer) 在 System.Net.Mail.Message.Send(BaseWriter writer, Boolean sendEnvelope) 在 System.Net.Mail.SmtpClient。發送(MailMessage 消息) — 內部異常堆棧跟踪結束 —
我在這裡閱讀了這個連接錯誤列表:http ://connect.microsoft.com/VisualStudio/feedback/details/544562/cannot-send-e-mails-with-large-attachments-system-net-mail-smtpclient-system-網路郵件郵件消息。
如果有人關心這個問題,請在 Connect 上投票,以便盡快修復。
該錯誤已修復:https ://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=30226
標題:KB2183292
發售日期:2010 年 7月 21 日
大小:8.58 MB
版本:修補程序
類別: 建構
說明QFE:System.Net.Mail - 如果文件附件大於 3MB,SmtpClient 類將引發異常