使用MailMessage.AlternateViews时遇到的小问题
這是微軟MSDN公布的Fix,希望對碰到同樣問題的朋友有所幫助:
This appears to be inaccurate. The AlternateView class does not have a constructor that takes a string as the first argument and a media type as the second. This throws an error when I try it, because it treats the body variable as a file name and attempts to find said file.
Here's the fix:
AlternateView alternate = AlternateView.CreateAlternateViewFromString(body, null, MediaTypeNames.Text.Html);
Courtesy of Mike Pope's site:
http://www.mikepope.com/blog/AddComment.aspx?blogid=1264
轉載于:https://www.cnblogs.com/SamZhang/archive/2007/07/11/814635.html
總結
以上是生活随笔為你收集整理的使用MailMessage.AlternateViews时遇到的小问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 3ds Max怎么打造飞奔的卡通汽车形象
- 下一篇: nex双屏防水吗(2020年索尼nex7