<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>mstehle: The CDOs and CDONTS of Messaging Development : System.Net.Mail</title><link>http://blogs.msdn.com/mstehle/archive/tags/System.Net.Mail/default.aspx</link><description>Tags: System.Net.Mail</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>FYI: MSDN Doco Correction: System.Net.Mail AlternateView doc error...</title><link>http://blogs.msdn.com/mstehle/archive/2006/06/27/fyi-msdn-doco-correction-system-net-mail-alternateview-doc-error.aspx</link><pubDate>Tue, 27 Jun 2006 22:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:648900</guid><dc:creator>mstehle</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/mstehle/comments/648900.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mstehle/commentrss.aspx?PostID=648900</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mstehle/rsscomments.aspx?PostID=648900</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;A href="http://blogs.geekdojo.net/ryan/archive/2006/01/03/systemnetmail_doc_error.aspx"&gt;&lt;FONT color=#800080&gt;Ryan Rinaldi&lt;/FONT&gt;&lt;/A&gt; does a good job of pointing out an error in our MSDN documentation on the AlternateView class, part of System.Net.Mail.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Our product &lt;A href="http://msdn2.microsoft.com/en-us/library/system.net.mail.mailmessage.alternateviews.aspx"&gt;&lt;FONT color=#800080&gt;documentation&lt;/FONT&gt;&lt;/A&gt; for the AlternateViews property in MSDN and in the SDK includes a sample for adding an HTML body to a MailMessage.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The error is in the use of the AlternateView constructor…&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BACKGROUND: #d9d9d9; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-shading: windowtext; mso-pattern: gray-15 auto; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 border=1&gt;
&lt;TBODY&gt;
&lt;TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 6.65in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" vAlign=top width=638&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;AlternateView alternate = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; AlternateView(body, MediaTypeNames.Text.Html);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'"&gt;While this use of the constructor does fit &lt;A href="http://msdn2.microsoft.com/en-us/library/ms144589.aspx"&gt;&lt;FONT color=#800080&gt;one&lt;/FONT&gt;&lt;/A&gt; of its signatures and the code will compile it is not correct in that the constructor is looking for a file path in the first string not the body text.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In order to create an HTML AlternateView from an HTML string such as the &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;body&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'"&gt; created in this example, use the static &lt;A href="http://msdn2.microsoft.com/en-us/library/ms144595.aspx"&gt;&lt;FONT color=#800080&gt;CreateAlternateViewFromString&lt;/FONT&gt;&lt;/A&gt; method as seen below…&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BACKGROUND: #d9d9d9; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-shading: windowtext; mso-pattern: gray-15 auto; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 border=1&gt;
&lt;TBODY&gt;
&lt;TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 6.65in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" vAlign=top width=638&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;AlternateView alternate = AlternateView.CreateAlternateViewFromString(body, MediaTypeNames.Text.HTML);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'"&gt;…I wish it was as simple as firing up notepad and correcting the documentation but it isn’t.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We will get this content corrected.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I definitely appreciate Ryan and my customer for pointing out this error…&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'"&gt;…NOTE: An important note about how Support Services works here at Microsoft as it relates to this issue.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;A customer brought this documentation error to my attention through a support case at Microsoft.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Please note that in the case of reporting a bug with our products or documentation, you will be refunded any payment made to Microsoft for a support incident.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you are still hesitant to open a case for whatever reason please contact me using the email link or contact our newsgroups.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We do listen and we do want to improve our products and their documentation…&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=648900" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mstehle/archive/tags/FYI/default.aspx">FYI</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/System.Net.Mail/default.aspx">System.Net.Mail</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category></item><item><title>FYI: System.Web.Mail is deprecated use System.Net.Mail</title><link>http://blogs.msdn.com/mstehle/archive/2005/11/29/fyi-system-web-mail-is-deprecated-use-system-net-mail.aspx</link><pubDate>Tue, 29 Nov 2005 18:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:497872</guid><dc:creator>mstehle</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/mstehle/comments/497872.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mstehle/commentrss.aspx?PostID=497872</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mstehle/rsscomments.aspx?PostID=497872</wfw:comment><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;While we are on the topic of &lt;A href="http://msdn2.microsoft.com/en-us/library/system.web.mail.aspx"&gt;System.Web.Mail&lt;/A&gt;, it is important to note a new namespace in version 2.0 of the .NET Framework.&amp;nbsp;&amp;nbsp;There is a&amp;nbsp;brand new namespace for sending mail&amp;nbsp;via managed code, it&amp;nbsp;is called &lt;A href="http://msdn2.microsoft.com/en-us/library/system.net.mail.aspx"&gt;System.Net.Mail&lt;/A&gt;.&amp;nbsp; Have no fear, System.Web.Mail is still accessible in v2.0 but it is deprecated.&amp;nbsp; (Which means v2.0 won't break your code but you should strongly consider using System.Net.Mail in new development.)&amp;nbsp; The documentation for System.Web.Mail is updated to reflect this.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;This is more than an annoying namespace change.&amp;nbsp; This is a reimplementation of the mail objects in .NET in order to seperate System.Net.Mail completely from CDOSYS therefore making it a completely managed solution.&amp;nbsp; In the coming weeks I hope to investigate these new objects further, creating or linking to how-to's, and making sure to point out the major differences between the old and new objects.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;EM&gt;...A great improvement of SNM over SWM is that there is not COM interop involved which should greatly improve performance.&amp;nbsp; Additionally, SWM was merely a wrapper for CDOSYS and only exposed limited functionality available in CDOSYS.&amp;nbsp; SNM is a complete implementation, I look forward to illustrating how to do things in SNM that weren't exposed by SWM.&amp;nbsp; Stay tuned...&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=497872" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mstehle/archive/tags/FYI/default.aspx">FYI</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/System.Net.Mail/default.aspx">System.Net.Mail</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/System.Web.Mail/default.aspx">System.Web.Mail</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/CDOSYS/default.aspx">CDOSYS</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/CDONTS/default.aspx">CDONTS</category></item></channel></rss>