首页 新闻 会员 周边

jmail4.4pro接收邮件,标题出现乱码

0
[已解决问题] 解决于 2008-02-13 12:17
具体状况如下: <BR>&nbsp; &nbsp; 邮件是用System.Net.Mail命名空间下的类编写代码发送的,以下是部分代码: <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string &nbsp; FromMail &nbsp; = &nbsp; "tangsiyanking@sina.com";//发件人 <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string &nbsp; Title &nbsp; = &nbsp; "mailnow测试邮件"; &nbsp; //邮件主题 <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string &nbsp; Body &nbsp; = &nbsp; "这是mailnow测试邮件"; &nbsp; &nbsp; &nbsp; //邮件主体 <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string &nbsp; ShowName &nbsp; = &nbsp; "paladintsy";//显示名字 <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string &nbsp; MailUserName &nbsp; = &nbsp; "tangsiyanking"; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string &nbsp; MailPassword &nbsp; = &nbsp; "xxxxxx";//密码,俺就不给了。。。 <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.Net.Mail.MailMessage &nbsp; msg &nbsp; = &nbsp; new &nbsp; System.Net.Mail.MailMessage(); <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msg.From &nbsp; = &nbsp; new &nbsp; MailAddress(FromMail, &nbsp; ShowName, &nbsp; System.Text.Encoding.UTF8); <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msg.Subject &nbsp; = &nbsp; Title;//邮件标题 &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msg.SubjectEncoding &nbsp; = &nbsp; System.Text.Encoding.UTF8;//标题采用UTF8编码 <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msg.Body &nbsp; = &nbsp; Body;//邮件内容 &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msg.BodyEncoding &nbsp; = &nbsp; System.Text.Encoding.UTF8;//邮件内容编码采用utf8 <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msg.Priority &nbsp; = &nbsp; MailPriority.Normal;//邮件优先级 &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msg.To.Add("seu_tangsiyan@qq.com");//收件人 <BR>这封邮件是可以成功发送的,邮件内容通过直接登录QQ邮箱或者用Windows &nbsp; Live &nbsp; Mail收取到本地都可以正常显示。但是用jmail收取以后在控制台中显示内容,却发现标题是乱码,而邮件内容是正常显示的。下面给出收邮件的部分代码: <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string &nbsp; subject; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string &nbsp; body; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string &nbsp; htmlbody; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
cloudgamer的主页 cloudgamer | 菜鸟二级 | 园豆:280
提问于:2008-02-04 02:02
< >
分享
最佳答案
0
会不是编码问题, 有些工具,不支持UTF-8 的编码
G yc {Son of VB.NET} | 老鸟四级 |园豆:2006 | 2008-02-13 11:15
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册