通过我的c#应用程序发送邮件时遇到问题。当我发送邮件时收到的邮件主题是=?UTF-8?B?dGVzdA ==?= [英] I'm having problem while sending mail through my c# application. when i'm sending mail the subject of the mail is received like =?UTF-8?B?dGVzdA==?=

查看:145
本文介绍了通过我的c#应用程序发送邮件时遇到问题。当我发送邮件时收到的邮件主题是=?UTF-8?B?dGVzdA ==?=的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是我正在使用的代码

mailObj.SubjectEncoding = System.Text.Encoding.UTF8;

mailObj.BodyEncoding = Encoding.GetEncoding(" utf -8");

mailObj.SubjectEncoding = Encoding.GetEncoding(" utf-8");

here is the code i'm using
mailObj.SubjectEncoding = System.Text.Encoding.UTF8;
mailObj.BodyEncoding = Encoding.GetEncoding("utf-8");
mailObj.SubjectEncoding = Encoding.GetEncoding("utf-8");

推荐答案

这是格式用于在电子邮件标题中使用编码

https:/ /en.wikipedia.org/wiki/Unicode_and_email#Unicode_support_in_message_header [ ^ ],

https://tools.ietf.org/html/rfc5335 [ ^ ],

< a href =https://tools.ietf.org/html/rfc6532> https://tools.ietf.org/html/rfc6532 [ ^ ]。



您可以将其解码为Unicode字符串。



您可以找到执行此转换的代码,特别是在开源产品OpenPOP.NET中: http://sourceforge.net/projects/hpop [ ^ ]。



不要害怕:即使这个产品是以POP3协议命名的,它确实包含了客户端协议的实现,但大多数代码都致力于解析邮件消息,并对所有各种代码进行全面观察和记录。 MIME和IANA标准。我不认为代码本身非常好,但至少它是一个非常好的信息源和邮件消息中涉及的各种格式的实现。



你的帖子不允许清楚地看你是否发送了正确或错误的信息。



-SA
This is the format used to use encodings in e-mail headers:
https://en.wikipedia.org/wiki/Unicode_and_email#Unicode_support_in_message_header[^],
https://tools.ietf.org/html/rfc5335[^],
https://tools.ietf.org/html/rfc6532[^].

You can decode it into a Unicode string.

You can find code doing this conversion, in particular, in the open-source product "OpenPOP.NET": http://sourceforge.net/projects/hpop[^].

Don't be afraid: even though this product is named after POP3 protocol and it really contains the implementation of the protocol on the client side, most of the code is devoted to parsing of mail messages, with thorough observation and documentation on all those various MIME and IANA standards. I don't think the code itself is very good, but at least it is a very good source of information and implementations of various formats involved in mail messages.

Your post does not allows to clearly see if you send correct or wrong messages.

—SA


这篇关于通过我的c#应用程序发送邮件时遇到问题。当我发送邮件时收到的邮件主题是=?UTF-8?B?dGVzdA ==?=的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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