本文介绍了使用.NET 2.0和C#发送附件时出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将Excel文件作为附件发送时,出现以下错误.

System.Net.Mail.SmtpException:发送文件失败---> System.ObjectDisposedException:无法访问关闭的文件.
在System.Net.Mime.MimeBasePart.EndSend(IAsyncResult asyncResult)
在System.Net.Mail.Message.EndSend(IAsyncResult asyncResult)
在System.Net.Mail.SmtpClient.SendMessageCallback(IAsyncResult asyncResult)

并且文件未发送.

此错误是什么意思?

Frank

When sending a excel file as an attachment, I receive the following error.

System.Net.Mail.SmtpException: Failure sending file ---> System.ObjectDisposedException: Cannot access a closed file.
at System.Net.Mime.MimeBasePart.EndSend(IAsyncResult asyncResult)
at System.Net.Mail.Message.EndSend(IAsyncResult asyncResult)
at System.Net.Mail.SmtpClient.SendMessageCallback(IAsyncResult asyncResult)

And the file is not sent.

What does this error mean?

Frank

推荐答案




这篇关于使用.NET 2.0和C#发送附件时出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 06:05