如何在exchange服务器上通过电子邮件发送.zip附件?

发布于 2024-09-14 20:44:20 字数 526 浏览 5 评论 0原文

天哪,

我正在用 csharp 编码来发送一封包含 .zip 文件(里面有 html 和 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'

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

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

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

艾伦

Hell guys,

I'm coding in csharp to send an email which contains a .zip file (has htmls and css inside). When I check the mail recieved, In fact, instead of the .zip file, the attachment becomes a txt file and has:

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'

The exchange server has blocked the zip file..I'm using CDO to create and send the email.

I tried using the code to send a mail with a zip file generated by WINZIP, there was no problem, then I tried using outlook to send a mail with the zip file generated by my code(I use sharpziplib library), the problem occured...

How can I do to send the attachment correctly? Many thanks in advance!

Allen

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

北笙凉宸 2024-09-21 20:44:20

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

I encounter similar problems sending email on our network. I've found that using an alternate compression format, such as 7-zip (.7z), is adequate to get my content through the filters. This could resolve the issue if the block is not due strictly to size.

涫野音 2024-09-21 20:44:20

看起来您的邮件服务器或垃圾邮件服务已删除您的附件并将其替换为 txt 文件,听起来您的代码没问题,您需要与管理员讨论邮件过滤器和发送大小配额!

Looks like your mail server or spam service have removed your attachement and replaced it with the txt file, it sounds like your code is fine and you need to speak to an admin regarding the mail filters and send size quotas!

灰色世界里的红玫瑰 2024-09-21 20:44:20

对于遇到此问题的任何人,这里有一个解决方案。您必须显式设置 zipentry 的文件大小。

ZipEntry newEntry = new ZipEntry(fileName);
newEntry.DateTime = DateTime.Now;
newEntry.Size = fileData.Length; // setting data size

For anyone facing this problem, here is a solution. You have to explicitly set the file size for the zipentry.

ZipEntry newEntry = new ZipEntry(fileName);
newEntry.DateTime = DateTime.Now;
newEntry.Size = fileData.Length; // setting data size
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文