<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">sunitc's WebLog</title><subtitle type="html" /><id>http://blogs.msdn.com/sunitc/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sunitc/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/sunitc/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2004-05-03T17:47:00Z</updated><entry><title>System.Web.Mail</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sunitc/archive/2004/05/31/144989.aspx" /><id>http://blogs.msdn.com/sunitc/archive/2004/05/31/144989.aspx</id><published>2004-05-31T21:11:00Z</published><updated>2004-05-31T21:11:00Z</updated><content type="html">&lt;P&gt;&lt;FONT face=Verdana color=#a52a2a size=2&gt;It has been a long time since I have written a&amp;nbsp;component that sends email.&amp;nbsp; In the .NET world, sending email has been made very easy and all the objects are defind under the System.Web.Mail namespace.&amp;nbsp; System.Web.Mail is a simple wrapper for the COM objects in cdonts.dll and cdosys.dll.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#a52a2a size=2&gt;Following is a code snipped for sending email with an attachment:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;MailMessage MailMsg= new MailMessage();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;MailMsg.To = "&lt;/FONT&gt;&lt;A href="mailto:sunitc@microsoft.com"&gt;&lt;FONT face=Verdana size=2&gt;sunitc@microsoft.com&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;MailMsg.From = "&lt;/FONT&gt;&lt;A href="mailto:SWM_Test@sunitc.com"&gt;&lt;FONT face=Verdana size=2&gt;SWM_Test@sunitc.com&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;MailMsg.Subject = "[info] System.Wed.Mail Test Message";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;MailMsg.Body = "System.Web.Mail Body of the Message";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Create the attachment : enter the correct path to the file that is to be attached&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;MailAttachment attachment = new MailAttachment("mypath\test.txt"); //create the attachment&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;MailMsg.Attachments.Add( attachment );&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Put in your real smtp server below&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SmtpMail.SmtpServer = "mySmtpServer"; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SmtpMail.Send( MailMsg);&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=144989" width="1" height="1"&gt;</content><author><name>sunitc</name><uri>http://blogs.msdn.com/members/sunitc.aspx</uri></author></entry><entry><title>May you live in Interesting times</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sunitc/archive/2004/05/03/125297.aspx" /><id>http://blogs.msdn.com/sunitc/archive/2004/05/03/125297.aspx</id><published>2004-05-04T00:47:00Z</published><updated>2004-05-04T00:47:00Z</updated><content type="html">&lt;FONT face=Verdana color=#000080&gt;
&lt;P&gt;&lt;SPAN style="COLOR: navy; FONT-FAMILY: Verdana"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: navy; FONT-FAMILY: Verdana"&gt;After months of unrelenting pressure from my big brother (Vinit Carpenter), I have decided to start blogging. :-)&amp;nbsp; &lt;/SPAN&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: navy; FONT-FAMILY: Verdana"&gt;I am an App Dev consultant and work for Microsoft Consulting Services.&amp;nbsp; I primarily work with Biztalk Server 2004 and .NET related technologies.&amp;nbsp; I recently moved to &lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;&lt;st1:City w:st="on"&gt;Miami&lt;/st1:City&gt; from &lt;st1:place w:st="on"&gt;&lt;st1:City w:st="on"&gt;Santa Monica&lt;/st1:City&gt;, &lt;st1:State w:st="on"&gt;CA&lt;/st1:State&gt;&lt;/st1:place&gt; and am now focused on public sector related projects.&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: navy; FONT-FAMILY: Verdana"&gt;In the coming days, weeks and months, I will have many interesting technical and non technical tit-bits to share and will do so via my blog.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=125297" width="1" height="1"&gt;</content><author><name>sunitc</name><uri>http://blogs.msdn.com/members/sunitc.aspx</uri></author></entry></feed>