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。提前致谢。