ASP.NET发送邮件
发送成功,但收不到! 传到服务器上就显示ó?·t???÷μ?′?ê?á??ó꧰ü?£乱码!
发送成功,但收不到! 传到服务器上就显示ó?·t???÷μ?′?ê?á??ó꧰ü?£乱码!
答案:用jmail组件public void Remail() { //n=第几封信 jmail.Message Msg=new jmail.Message(); jmail.POP3 jpop=new jmail.POP3(); try { jpop.Connect("gl77","8562","pop3.163.com",110); Count.Text=jpop.Count.ToString(); Msg = jpop.Messages[n]; Sendform.Text = Msg.FromName; Subject.Text = Msg.Subject; Datetime.Text = Msg.Date.ToString(); Body.Text = Msg.Body; num.Text=Msg.Attachments.Count.ToString(); for(int i=0;i<Msg.Attachments.Count;i++) { f=f+Msg.Attachments[i].SaveToFile("c:\\"+Msg.Attachments[n].Name); } name.Text=f; jpop.Disconnect(); } catch(Exception ex) { Count.Text=ex.Message.ToString(); } }发送邮件的时候,要指定字符集为UTF8,就不会有乱码问题了。
上一个:ASP.NET的问题
下一个:如何学好asp.net