Microsoft KB Archive/922784

= There is a documentation error in the code example of the &quot;MailMessage.AlternateViews Property&quot; MSDN article =

Article ID: 922784

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft .NET Framework 2.0

-





INTRODUCTION
This article discusses a documentation error that occurs in the code example of the &quot;MailMessage.AlternateViews Property&quot; MSDN article in the MSDN library.



MORE INFORMATION
The code example in this MSDN article is incorrect at the line where the body string is passed to the AlternateView constructor. The current block of code provides an HTML stream to the constructor. The current block of code reads as follows: // Add the alternate body to the message. AlternateView alternate = new AlternateView(body, MediaTypeNames.Text.Html); message.AlternateViews.Add(alternate); The current block of code does not work because the constructor is looking for a file path. The corrected block of code reads as follows: // Add the alternate body to the message. AlternateView alternate = AlternateView.CreateAlternateViewFromString(body); message.AlternateViews.Add(alternate); For more information about the original MSDN article, visit the following Microsoft Developer Network (MSDN) Web site:

http://msdn2.microsoft.com/en-us/library/system.net.mail.mailmessage.alternateviews.aspx

Keywords: kbtshoot kbbug kbfix kbdocerr KB922784

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.