Dim msg As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage()
msg.BodyEncoding = Encoding.UTF8
msg.SubjectEncoding = Encoding.UTF8
Dim plainView As AlternateView = AlternateView.CreateAlternateViewFromString(PrintablePage.StripHTML(body).Trim, System.Text.Encoding.UTF8, "text/plain")
msg.AlternateViews.Add(plainView)
Dim userState As Object = msg
Response.Write(userState)
我解压缩eml文件并获取正文消息,以便能够将数据库作为varchar数据类型插入。这里的问题是如何将eml文件转换为vb.net中的字符串。我正在使用.net 3.5 sp1和数据库是MSSQL 2008.在此先感谢。