Skip to main content
 首页 » 编程设计

c#之如何在 Exchange 服务器上通过电子邮件发送 .zip 附件

2024年02月24日36softidea

天啊,

我在 csharp 中编码以发送包含 .zip 文件(里面有 htmls 和 css)的电子邮件。当我检查收到的邮件时,实际上,附件不是 .zip 文件,而是一个 txt 文件并且具有:

FILE QUARANTINED 
 
The original contents of this file have been replaced with 
this message because of its characteristics. 
File name: 'xxxxxxx_Result.zip' 
Virus name: 'Large uncompressed size' 

交换服务器阻止了 zip 文件。我正在使用 CDO 创建和发送电子邮件。

我尝试使用代码发送带有 WINZIP 生成的 zip 文件的邮件,没有问题,然后我尝试使用 outlook 发送带有我的代码生成的 zip 文件的邮件(我使用 sharpziplib 库),出现问题...

如何正确发送附件?非常感谢!

艾伦

请您参考如下方法:

我在我们的网络上发送电子邮件时遇到了类似的问题。我发现使用替代压缩格式(例如 7-zip (.7z))足以让我的内容通过过滤器。如果 block 不是严格按照尺寸大小,这可以解决问题。