System.Net.Mail中的错误? (.NET 4) [英] Bug in System.Net.Mail? (.NET 4)

查看:80
本文介绍了System.Net.Mail中的错误? (.NET 4)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级到.NET 4后,我们的用户开始收到附件中非常奇怪的错误。似乎如果附件的名称包含强制它编码的字符(如åäö)并且名称很长(例如30-40个字符),
附件已损坏(因为邮件客户端无法正确识别它。它变成了一个带有乱码名称和内部BASE64编码内容的txt文件。

After upgrading to .NET 4, our users started getting really weird errors with attachments. It seems that if the name of the attachment contains characters that forces it to be encoded (like åäö) AND the name is long (say 30-40 characters), the attachment is corrupt (since the mail client can't identify it properly. It becomes a txt-file with a garbled name and the BASE64-encoded content inside..

我们为附件尝试了不同的名称编码但它似乎并没有多大好处。

We've tried different name-encodings for the attachments, but it doesn't seem to do much good.

当我看一下邮件来源时,附件部分就是这样开始的:

When I take a look at the mail source the attachment-part starts like this:

Content-Type:application / octet-stream;

  name =" =?utf-8?B?PT91dGYtOD9CP1RXRjRhVzFsY21FZ2JNT2tjbUZ1WkdWMElHbHVibUZ1?= \\\
\



  =?utf-8?B?SUdScGJpQjFkR0pwYkdSdWFXNW5MbkJrPz0NCiA9P3V0Zi04P0I / Wmc9?= \

\

  ; =?utf-8?B?PT89?=&​​quot; b $ b内容 - 转移 - 编码:base64

内容 - 处置:附件

Content-Type: application/octet-stream;
 name="=?utf-8?B?PT91dGYtOD9CP1RXRjRhVzFsY21FZ2JNT2tjbUZ1WkdWMElHbHVibUZ1?=\
\

 =?utf-8?B?SUdScGJpQjFkR0pwYkdSdWFXNW5MbkJrPz0NCiA9P3V0Zi04P0I/Wmc9?=\
\
 =?utf-8?B?PT89?="
Content-Transfer-Encoding: base64
Content-Disposition: attachment

 

任何人都可以这样想解决方案,还是解决方法?我不想切换到另一个邮件组件,但我们可能需要:/

Can anyone think of a solution, or a workaround? I'd prefer not to switch to another mail component, but we might have to :/

推荐答案

任何人?


这篇关于System.Net.Mail中的错误? (.NET 4)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆