<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Marc Mezzacca&#039;s Notebook</title>
	<atom:link href="http://blog.marcmezzacca.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.marcmezzacca.com</link>
	<description>An entrepreneur&#039;s notes on programming, going green and other ramblings...</description>
	<lastBuildDate>Mon, 12 Mar 2012 15:29:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Best Charting Library for .NET MVC 3</title>
		<link>http://blog.marcmezzacca.com/2012/03/best-charting-library-for-net-mvc-3/</link>
		<comments>http://blog.marcmezzacca.com/2012/03/best-charting-library-for-net-mvc-3/#comments</comments>
		<pubDate>Mon, 12 Mar 2012 15:29:32 +0000</pubDate>
		<dc:creator>marc</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[.net charting]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[charting]]></category>
		<category><![CDATA[highcharts]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[mvc3]]></category>
		<category><![CDATA[telerik]]></category>

		<guid isPermaLink="false">http://blog.marcmezzacca.com/2012/03/best-charting-library-for-net-mvc-3/</guid>
		<description><![CDATA[While there are a number of charting options out there that utilize jQuery or other technologies, I&#8217;m currently looking into look at those offered from two companies: Highcharts and Telerik – including extensions and open source projects available to complement them and ease usage in ASP.NET MVC.&#160; I figured I’d share my research so far…
Highcharts
Highcharts [...]]]></description>
			<content:encoded><![CDATA[<p>While there are a number of charting options out there that utilize jQuery or other technologies, I&#8217;m currently looking into look at those offered from two companies: Highcharts and Telerik – including extensions and open source projects available to complement them and ease usage in ASP.NET MVC.&#160; I figured I’d share my research so far…</p>
<h4>Highcharts</h4>
<p><a href="http://www.highcharts.com/">Highcharts</a> is a charting library written in pure JavaScript, offering an easy way of adding interactive charts to your web site or web application. Highcharts cost <strong>$80</strong> for a single website license and <strong>$360</strong> for a single developer / web application license. </p>
<p>For .NET developers who don’t want to dive into client-side JavaScript and jQuery to create their charts, options do exist.&#160; While Highcharts doesn&#8217;t offer an ASP.NET library directly, however there are a few open source options available.</p>
<p><a href="http://blog.marcmezzacca.com/wp-content/uploads/2012/03/clip_image0024.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image002[4]" border="0" alt="clip_image002[4]" src="http://blog.marcmezzacca.com/wp-content/uploads/2012/03/clip_image0024_thumb.jpg" width="628" height="215" /></a></p>
<h5>DotNet.Highcharts</h5>
<p><a href="http://dotnethighcharts.codeplex.com/">DotNet.Highcharts</a> is &quot;the .NET way to display Highcharts into your ASP.NET application.&quot; The library proclaims easy integration with ASP.NET applications and that you&#8217;ll only need to write in C# (no JavaScript coding needed &#8212; however the output code is pure JavaScript). Of course, you will actually need to use JS coding if you want to do more advanced functions like AJAX loading.</p>
<p>The most <a href="http://dotnethighcharts.codeplex.com/releases/view/83064">recent release</a> comes with over 35 example charts including Multiple X-Axes, Chart inside JavaScript function, Multiple charts in one page, Disable Animation, Bind Decimal Values, and more. It is available as a <a href="http://nuget.org/packages/DotNet.Highcharts">NuGet package</a> as well.&#160; Developed by <a href="http://twitter.com/#!/Vangii">Vangel Kolarov</a>.</p>
<h5>Highcharts MVC</h5>
<p><a href="https://github.com/oenning/highcharts-mvc">Highcharts MVC</a> is &quot;an Open-source Highcharts wrapper for ASP.NET MVC which aims to provide a better, easier and cleaner API.&quot; Currenty the source is hosted on GitHub. This has also <a href="http://geekstuff.cc/2012/01/18/highcharts-mvc-is-now-on-nuget">been made available</a> as a NuGet package. Three <a href="http://playground.geekstuff.cc/highcharts/examples">examples</a> showcase the ability to use the library in simple, advance, and AJAX scenarios. More information is available at the developer&#8217;s <a href="http://playground.geekstuff.cc/highcharts">website</a>.&#160; Developed by <a href="http://twitter.com/#!/goenning">Guilherme Oenning</a>.</p>
<h5>Highcharts .Net (WebForms)</h5>
<p><a href="http://highcharts.codeplex.com/">Highcharts .Net</a> encapsulates the Highcharts API on ASP.net controls making it easier to use. It is free for non-commerical use. At this time it doesn&#8217;t seem to formally support ASP.NET MVC at this time (only WebForms), however there is a <a href="http://highcharts.codeplex.com/discussions/271524">discussion of usage with MVC 3</a>. Note: It looks like a hack / workaround to me. <a href="http://highcharts.paulovich.com.br/Sample02.aspx">Examples</a> and more information at the developer&#8217;s <a href="http://highcharts.paulovich.com.br/Default.aspx">website</a>.&#160; Developed by <a href="http://twitter.com/#!/andrepaulovich">André Paulovich</a> and <a href="http://twitter.com/#!/alrcastro">André Castro</a>. </p>
<h4>&#160;</h4>
<h4>Telerik Extensions for MVC </h4>
<p><a href="http://blog.marcmezzacca.com/wp-content/uploads/2012/03/clip_image0044.jpg"><img style="margin: 0px 0px 0px 10px; display: inline; float: right" title="clip_image004[4]" alt="clip_image004[4]" align="right" src="http://blog.marcmezzacca.com/wp-content/uploads/2012/03/clip_image0044_thumb.jpg" width="194" height="166" /></a><a href="http://demos.telerik.com/aspnet-mvc/">Telerik Extensions for ASP.NET MVC</a> is &quot;a comprehensive set of native MVC, jQuery-powered UI components that help you deliver richer apps to market faster.&quot; Charting is offered out of box, and examples exist. The <a href="http://demos.telerik.com/aspnet-mvc/chart">examples</a> range from simple to complex and all come with the source code.</p>
<p>The extension is HTML5-based, and chart rendering utilizes lightweight SVG-powered engine for modern browsers with a fallback to VML for legacy browsers.</p>
<p>Aside from open source projects, Telerik Extensions for ASP.NET MVC comes in at a hefty price tag of <strong>$999</strong>, and is really only suitable for businesses that can afford it. The Telerik code is <a href="http://telerikaspnetmvc.codeplex.com/">hosted on CodePlex</a>.</p>
<h4>Telerik KendoUI</h4>
<p><img style="margin: 0px 0px 0px 10px; display: inline; float: right" align="right" src="http://www.kendoui.com/Libraries/Banners/dataviz_configuration.sflb.ashx" width="223" height="169" /><a href="http://www.kendoui.com/">KendoUI</a> is the new kid on the block, and allows developers to build modern web apps with HTML5 / JavaScript. Charting is only one small feature amongst over fifteen included in this Framework. KendoUI current costs <strong>$399</strong> for a developer license, and offers charting through its DataViz package (currently free with Web for a limited time). KendoUI is not tied to any server-side library as is the case with Telerik&#8217;s ASP.NET MVC Extensions. Currently there is minimal support in the ASP.NET realm.</p>
<h5>Kendo MVC Extensions for ASP.NET</h5>
<p>The <a href="http://kendomvcextensions.codeplex.com/">Kendo MVC Extensions for ASP.NET</a> library aims to &quot;makes it easier for ASP.NET MVC developers to implement the Kendo UI JavaScript framework.&quot; A sample exists of how to use the <a href="http://kendomvcextensions.codeplex.com/wikipage?title=Chart">Chart function</a>.</p>
<h4>Other Options?</h4>
<p>Again, many other controls exist, but several that I came across were geared towards WebForms, build for Silverlight or were a bit older (eg. <a href="http://netcontrols.org/nplot/">NPlot</a> and Microsoft Chart Controls). There is a post about usage of <a href="http://social.msdn.microsoft.com/Forums/en/MSWinWebChart/thread/e5d2b15e-4a52-43e9-be22-13a0c5b53545">Microsoft&#8217;s Chart Controls of .NET with MVC</a> and more information in <a href="http://stackoverflow.com/questions/6281520/charting-in-asp-net-mvc-3">this Stackoverflow post</a>. You also always have the option to work with JavaScript more directly, or create your own API wrapper for <a href="http://www.1stwebdesigner.com/css/top-jquery-chart-libraries-interactive-charts/">other top jQuery charting libraries</a>.</p>
<h4>Conclusion</h4>
<p> Dotnet.Highcharts definitely has the most examples, so that is a win in my book. It makes getting started and understanding the code that much easier.&#160; KedoUI is still quite new, but it looks slick and so I’ll be giving the DataViz a try as well with their free thirty-day trial.&#160; While Telerik Extensions provides a stable, robust product, paying a thousand bucks for MVC extensions seems too heavy for me, especially since I mainly require charting.    </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marcmezzacca.com/2012/03/best-charting-library-for-net-mvc-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Social Authentication for .NET &#8211; A Library Comparison</title>
		<link>http://blog.marcmezzacca.com/2012/03/social-authentication-for-net-a-library-comparison/</link>
		<comments>http://blog.marcmezzacca.com/2012/03/social-authentication-for-net-a-library-comparison/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 14:21:37 +0000</pubDate>
		<dc:creator>marc</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[dotnetopenauth]]></category>
		<category><![CDATA[janrain]]></category>
		<category><![CDATA[socialauth]]></category>

		<guid isPermaLink="false">http://blog.marcmezzacca.com/2012/03/social-authentication-for-net-a-library-comparison/</guid>
		<description><![CDATA[What social authentication solutions are available for .NET developers? What are their features? These are questions I was looking to get answered. I’ve provided my findings in this article, which focuses primarily on active solutions, that have compatibility with ASP.NET MVC. I’ve listed four solutions: a direct DotNetOpenAuth implementation example (several exist), SimpleSocialAuth, SocialAuth.NET, and [...]]]></description>
			<content:encoded><![CDATA[<p>What social authentication solutions are available for .NET developers? What are their features? These are questions I was looking to get answered. I’ve provided my findings in this article, which focuses primarily on active solutions, that have compatibility with ASP.NET MVC. I’ve listed four solutions: a direct DotNetOpenAuth implementation example (several exist), SimpleSocialAuth, SocialAuth.NET, and a third-party, API-based solution called Janrain Engage.</p>
<h2>DotNetOpenAuth + OpenID-Selector</h2>
<p><a href="http://www.dotnetopenauth.net/">DotNetOpenAuth</a> can be used to build custom authentication solutions from the ground up. This is a general implementation of the DotNetOpenAuth library which uses a simple <a href="http://code.google.com/p/openid-selector/">JavaScript OpenID selector</a>. Haitham Khedre provides <a href="http://weblogs.asp.net/haithamkhedre/archive/2011/03/13/openid-authentication-with-asp-net-mvc3-dotnetopenauth-and-openid-selector.aspx">a full tutorial on how to accomplish establishing social authentication with OpenId</a> using the jQuery OpenID selector in MVC3 and has published the <a href="https://docs.google.com/leaf?id=0Bz8gXQfIEQb6Mjg5MDY2ZjctZGY4Ny00OTQxLThlN2YtMjM2M2JhOTgzODNm&amp;sort=name&amp;layout=list&amp;num=50">full source code</a>.&#160; <em>Note that other tutorials exist for using DotNetOpenAuth directly, so Google around to find one more akin to your liking</em>.</p>
<p><u>Pros</u></p>
<ul>
<li>Simple – Very simple implementation and the tutorial is fairly straight-forward.&#160; Could be a good starting point for building your own. </li>
</ul>
<p><u>Cons</u></p>
<ul>
<li>Support &#8211; Only OpenId is supported, and the code itself looks to be unmaintained.&#160; Likely will take some tweaking to actually using a in a production environment. </li>
</ul>
<h2>SimpleSocialAuth.MVC3</h2>
<p><a href="http://nuget.org/packages/SimpleSocialAuth.MVC3">SimpleSocialAuth</a> is a new solution, and it utilizes the DotNetOpenAuth library. It aims to fill the void of a simple, lightweight social authentication NuGet package for MVC. From the NuGet page: “Super simple and easy to install package that allows web sites creators to seamlessly add OAuth support to their ASP.NET MVC 3 sites. Supporting Twitter, Google and Facebook.”&#160; Integration with ASP.NET Membership is beyond the scope of the library, and is left to the developer to implement.</p>
<p><u>Pros</u></p>
<ul>
<li>Lightweight – You can easily get Authentication up and running for Facebook, Twitter or Google within minutes by adding in this NuGet package. </li>
<li>Extensible – Seems like a good starting point to build a custom solution off of. </li>
</ul>
<p><u>Cons</u></p>
<ul>
<li>Authentication Only – To do anything beyond authentication you’ll need to utilize other 3<sup>rd</sup> party libraries to communicate with the APIs (eg. Facebook SDK, Twitterizer, etc.), however this isn’t much of a con as it is by design and keeps it lightweight. </li>
</ul>
<h2>SocialAuth.NET</h2>
<p><a href="http://code.google.com/p/socialauth-net/">SocialAuth-NET</a> is an extensible .NET Library for authentication/authorization through Google, Yahoo, Facebook and other providers supporting OAuth. It provides social authentication, profile data, social sharing (consume REST API feeds of supported providers), and more. It is a port from the <a href="http://code.google.com/p/socialauth/">Java-based SocialAuth library</a>.&#160; They have only recently added support for MVC with the 2.x release of the library, and ASP.NET Membership integration is not currently supported.</p>
<p><u>Pros</u></p>
<ul>
<li>Features – It goes beyond authentication to offer social sharing, contact import and other features by communicating directly with the APIs to offer a bundled solution. </li>
<li>Coverage – It supports Facebook, Twitter, Google, Yahoo!, LinkedIn, MySpace and Hotmail / MSN out of the box, plus new providers are easily creatable. </li>
</ul>
<p><u>Cons</u></p>
<ul>
<li>Support – There are a number of <a href="http://code.google.com/p/socialauth-net/issues/list">reported issues</a> with no timeline in sight.&#160; You won’t get the same support level as you would with a paid solution.&#160; </li>
<li>Membership – They have not provided support for ASP.NET Membership, and the <a href="http://code.google.com/p/socialauth-net/issues/detail?id=18">issue remains open</a>, as well as a general issue with supporting both <a href="http://code.google.com/p/socialauth-net/issues/detail?id=13">traditional logins and social logins</a> simultaneously. </li>
</ul>
<h2>Janrain Engage</h2>
<p>Janrain provides a third party solution for handling Social Login, Social Sharing, Social Analytics and <a href="http://www.janrain.com/products/engage/features-comparison">more</a> with their <a href="http://www.janrain.com/products/engage" target="_blank">Janrain Engage product</a>. Troy Goode has provided a <a href="https://github.com/TroyGoode/EngageNet">NuGet package called EngageNet</a> that adds a wrapper library for the Janrain Engage service on ASP.NET MVC sites, though it was last updated a year ago. Janrain also provides a <a href="http://documentation.janrain.com/github-code-examples-and-sdks">very basic wrapper</a> (C#), but it definitely isn’t complete either. Other than that I struggled to find much in the way of .NET libraries for Janrain Engage. From what I remember (used it about 18 months ago), I had to write my own implementation for Pro/Enterprise features of the API like Account Mapping.</p>
<p><u>Pros</u></p>
<ul>
<li>Managed – A totally hands off approach. You setup to work with one API system and they handle the rest. </li>
<li>Coverage – Pretty much covers any authentication provider you would need, plus more. </li>
<li>Features – It goes beyond authentication to offer social sharing, contact import and other features by communicating directly with the APIs. </li>
<li>Support – You can expect more support than you would get with an open-source solution. </li>
</ul>
<p><u>Cons</u></p>
<ul>
<li>Third-party – You and your data are dependent on an intermediary party. If their solution is down, so is your login. And the lower levels of the service aren’t completely white-label so people could see you are using a third-party service, which they might not appreciate when considering their authentication details. </li>
<li>User Caps &amp; Cost – It gets costly for full features, with price caps at 10K / 25K users and beyond. Up to 10K users you are paying a $1000 / mo, which equates to a minimum of .10 per user or more. If you are planning to have a large user community, it could become very costly. </li>
<li>.NET Support – There isn’t much of a .NET community utilizing Janrain Engage, at least not those that are sharing their code publicly.&#160; You’ll have to dig and ask around for coding help using Pro/Enterprise plans. </li>
</ul>
<h2>Conclusion</h2>
<p>I should mention that the OAuth.net website provides <a href="http://oauth.net/code/">a list of extensions</a> / libraries itself, but, with the exception of DotNetOpenAuth, the others for .NET are old fairly old and seem unmaintained.&#160; This was one reason for putting this article together.</p>
<p>I’ve tried Janrain Engage myself, and after the initial implementation it does make things easier, even though I had to write my own integration code. While they offer the most robust out-of-box solution at this point in time, in the end I really disliked having to rely on a third-party solution and eventually dropped it.</p>
<p>I think the SocialAuth solution is positioned very well, and if BrickRed would put more focus, resources and priority on the library, I think they’d have a solution developers would embrace, and likely pay for. </p>
<p>In the end I still struggle to determine what is the best method of authentication and interacting with social websites using .NET, specifically within MVC. Should I use a full-blown solution like Janrain Engage or SocialAuth.NET, or use barebones Authentication provider in conjunction with the Facebook/Twitter libraries directly?&#160; </p>
<p>For now I’ll likely stick with a lightweight solution like SimpleSocialAuth.MVC3, and use the most stable SDKs directly.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marcmezzacca.com/2012/03/social-authentication-for-net-a-library-comparison/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>JavaScript / jQuery Clipboard and Flash Detection Plugins</title>
		<link>http://blog.marcmezzacca.com/2011/07/javascript-jquery-clipboard-and-flash-detection-plugins/</link>
		<comments>http://blog.marcmezzacca.com/2011/07/javascript-jquery-clipboard-and-flash-detection-plugins/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 16:46:13 +0000</pubDate>
		<dc:creator>marc</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flash detection]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://blog.marcmezzacca.com/2011/07/javascript-jquery-clipboard-and-flash-detection-plugins/</guid>
		<description><![CDATA[Listed below are some of my recent findings for the best JavaScript Clipboard and Flash Detection scripts for web developers.
Clipboard Plugins
Developers can provide end-users the ability to copy text to their clipboard (eg. mimic Ctrl+C action).
ZeroClipboard     This is the most active clipboard project available.&#160; Most robust, lots of options and active [...]]]></description>
			<content:encoded><![CDATA[<p>Listed below are some of my recent findings for the best JavaScript Clipboard and Flash Detection scripts for web developers.</p>
<h3>Clipboard Plugins</h3>
<p>Developers can provide end-users the ability to copy text to their clipboard (eg. mimic Ctrl+C action).</p>
<p><strong>ZeroClipboard</strong>     <br />This is the most active clipboard project available.&#160; Most robust, lots of options and active community.     <br /><a href="http://code.google.com/p/zeroclipboard">http://code.google.com/p/zeroclipboard</a></p>
<p>Example of ZeroClipboard with multiple per page    <br /><a href="http://www.webmasterworld.com/javascript/3901742.htm">http://www.webmasterworld.com/javascript/3901742.htm</a></p>
<p><strong>zClip jQuery Plugin</strong>    <br />zClip Wraps the ZeroClipboard functionality into jQuery and is worth checking out for those using jQuery and seeking a quick clipboard implementation:    <br /><a title="http://www.steamdev.com/zclip/" href="http://www.steamdev.com/zclip/">http://www.steamdev.com/zclip/</a></p>
<p><strong>jQuery Clipboard      <br /></strong>Another (older) clipboard plugins for jQuery.&#160; These only work prior to the &quot;actionable-effect requirement&quot; in Adobe 10 and works completely differently. <em>*This won’t work with the latest Flash versions*</em>    <br /><a href="http://plugins.jquery.com/project/copy">http://plugins.jquery.com/project/copy</a>     <br /><a href="http://plugins.jquery.com/project/clipboard">http://plugins.jquery.com/project/clipboard</a></p>
<h3>Detecting Flash </h3>
<p>Easily identify if the end-user has Flash capabilities installed on their web browser.</p>
<p><strong>Flash Detect (JavaScript Flash Detection Library) </strong>    <br />Doesn’t seem to require a separate SWF file.&#160; Small and easy to implement.     <br /><a href="http://www.featureblend.com/javascript-flash-detection-library.html">http://www.featureblend.com/javascript-flash-detection-library.html</a></p>
<p><strong>SWFObject      <br /></strong>Another good options for Flash Detection that is very reliable.     <br /><a href="http://code.google.com/p/swfobject/wiki/whats_new">http://code.google.com/p/swfobject/wiki/whats_new</a>     </p>
<p>Some example code can be found here:     <br /><a href="http://stackoverflow.com/questions/159261/cross-browser-flash-detection-in-javascript">http://stackoverflow.com/questions/159261/cross-browser-flash-detection-in-javascript</a></p>
<p><strong>jQuery Flash Plugin </strong>    <br />Used for embedding Flash movies but also has detection.     <br /><a href="http://jquery.lukelutman.com/plugins/flash/">http://jquery.lukelutman.com/plugins/flash/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marcmezzacca.com/2011/07/javascript-jquery-clipboard-and-flash-detection-plugins/feed/</wfw:commentRss>
		<slash:comments>119</slash:comments>
		</item>
		<item>
		<title>Customized ShareThis Button using jQuery and the ShareThis API</title>
		<link>http://blog.marcmezzacca.com/2011/07/customized-sharethis-button-using-jquery-and-the-sharethis-api/</link>
		<comments>http://blog.marcmezzacca.com/2011/07/customized-sharethis-button-using-jquery-and-the-sharethis-api/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 19:43:02 +0000</pubDate>
		<dc:creator>marc</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[sharethis]]></category>
		<category><![CDATA[sharethis api]]></category>

		<guid isPermaLink="false">http://blog.marcmezzacca.com/2011/07/customized-sharethis-button-using-jquery-and-the-sharethis-api/</guid>
		<description><![CDATA[Using ShareThis and want to have a customized version of multiple share buttons on one page?&#160; The ShareThis API developer docs section would have you include a hefty piece of JavaScript wherever you wanted the ShareThis object to occur.&#160; That is not only messy, but not very practical.&#160; I was shocked I couldn’t find anyone [...]]]></description>
			<content:encoded><![CDATA[<p>Using ShareThis and want to have a customized version of multiple share buttons on one page?&#160; The <a href="http://sharethis.com/developers/api" target="_blank">ShareThis API developer docs</a> section would have you include a hefty piece of JavaScript wherever you wanted the ShareThis object to occur.&#160; That is not only messy, but not very practical.&#160; I was shocked I couldn’t find anyone that had posted a jQuery tidbit to fix this.&#160; I <a href="http://forums.sharethis.com/topic.php?id=2857" target="_blank">found one attempt</a> posted in their forums, but no final solution.&#160; The solution below is based on the previous finding and this <a href="http://forums.sharethis.com/topic.php?id=147" target="_blank">forum thread</a>.</p>
<p>Be sure to read the developer docs and include the correct ShareThis widget JS file with your publisher Id prior to this code [ something like <a title="http://w.sharethis.com/widget/?tabs=web%2Cpost%2Cemail&amp;charset=utf-8&amp;style=default&amp;publisher=(pub-id)" href="http://w.sharethis.com/widget/?tabs=web%2Cpost%2Cemail&amp;charset=utf-8&amp;style=default&amp;publisher=(pub-id">http://w.sharethis.com/widget/?tabs=web%2Cpost%2Cemail&amp;charset=utf-8&amp;style=default&amp;publisher=(pub-id)</a> ]</p>
<p>What I’ve done is loop through any cases where the <em><strong>sharethis</strong> </em>class is present.&#160; Inside the link include all the necessary information in data-* attributes that we pull out using jQuery.</p>
<pre class="html">&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function () {
  SHARETHIS.onReady();
  $(&quot;a.sharethis&quot;).each(function (index) {
    var id = $(this).attr('data-id');
    var purl = '<a href="http://mydomain.com/posts/'">http://mydomain.com/posts/'</a> + id
    var ptitle = $(this).attr('data-title');
    var thisobj = SHARETHIS.addEntry({ title: ptitle, url: purl }, { button: false });
    thisobj.attachButton(document.getElementById(&quot;sharethis-&quot; + id));
  });
});
&lt;/script&gt;</pre>
<p>Example customized ShareThis Link</p>
<pre class="html">&lt;a class=&quot;sharethis&quot; data-id=&quot;(uniqueid)&quot; data-title=&quot;The Title of This Post&quot; id=&quot;sharethis-(uniqueid)&quot;&gt;Share&lt;/a&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.marcmezzacca.com/2011/07/customized-sharethis-button-using-jquery-and-the-sharethis-api/feed/</wfw:commentRss>
		<slash:comments>69</slash:comments>
		</item>
		<item>
		<title>Best Tag Editor jQuery Plugin</title>
		<link>http://blog.marcmezzacca.com/2011/06/best-tag-editor-jquery-plugin/</link>
		<comments>http://blog.marcmezzacca.com/2011/06/best-tag-editor-jquery-plugin/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 20:33:42 +0000</pubDate>
		<dc:creator>marc</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[tag editor]]></category>
		<category><![CDATA[tagging]]></category>

		<guid isPermaLink="false">http://blog.marcmezzacca.com/2011/06/best-tag-editor-jquery-plugin/</guid>
		<description><![CDATA[I searched around &#34;Googled around&#34; for a nice jQuery Tag editor, and it took me going through quite a few plugins before I found one that had everything I wanted… which included Autocomplete functionality using jQuery UI core. It looks nice, uses built-in Autocomplete, and has all the tag editor features.&#160; I must note that [...]]]></description>
			<content:encoded><![CDATA[<p>I <strike>searched around</strike> &quot;Googled around&quot; for a nice jQuery Tag editor, and it took me going through quite a few plugins before I found one that had everything I wanted… which included Autocomplete functionality using jQuery UI core. It looks nice, uses built-in Autocomplete, and has all the tag editor features.&#160; I must note that it works a little different then almost all other tag editor plugins I’ve seen in terms of work flow.&#160; It considers “remove from list” and “delete from list” two separate functions (<a href="https://github.com/webworka/Tagedit/issues/1#issuecomment-1265201" target="_blank">read this</a>).&#160; This can be very useful, or merely extra work, depending on your implementation on the back-end. Currently it is being actively <a href="https://github.com/webworka" target="_blank">developed</a> by Oliver Albrecht (aka @<a href="http://twitter.com/webworka" target="_blank">webworka</a>) and hopefully it stays in active development!&#160; </p>
<p><strong>jQuery Tagedit</strong>    <br />Demo: <a title="http://tagedit.webwork-albrecht.de&#13;&#10;" href="http://tagedit.webwork-albrecht.de">http://tagedit.webwork-albrecht.de</a>    <br />Code: <a title="https://github.com/webworka/Tagedit" href="https://github.com/webworka/Tagedit">https://github.com/webworka/Tagedit</a></p>
<p><a href="http://blog.marcmezzacca.com/wp-content/uploads/2011/06/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blog.marcmezzacca.com/wp-content/uploads/2011/06/image_thumb.png" width="406" height="98" /></a>     </p>
<p>I&#8217;m using it in the revamp for the <a href="http://couponfollow.com/" target="_blank">CouponFollow</a> website which I hope to push into private beta before the end of the month, and roll live shortly after.&#160; I&#8217;ll likely use this plugin in future projects as well.</p>
<p>Here are some others that I liked but didn&#8217;t make the final cut for this project.</p>
<p><strong>jQuery Tag It!     <br /></strong>Link: <a title="http://levycarneiro.com/projects/tag-it/example.html" href="http://levycarneiro.com/projects/tag-it/example.html">http://levycarneiro.com/projects/tag-it/example.html</a>    <br />Code: <a title="http://github.com/levycarneiro/tag-it" href="http://github.com/levycarneiro/tag-it">http://github.com/levycarneiro/tag-it</a>    <br /><em><u>My Notes:</u> Very simple, autocomplete using jQuery UI.&#160; Tagedit is based on this one.</em></p>
<p><strong>jQuery Tag Editor      <br /></strong>Link: <a href="http://blog.crazybeavers.se/wp-content/Demos/jquery.tag.editor/">http://blog.crazybeavers.se/wp-content/Demos/jquery.tag.editor/</a>    <br /><em><u>My Notes: </u>Good but no autoComplete. Some CSS overflow issues with large amount of tags. </em></p>
<p><strong>jQuery Tag Suggestion </strong>    <br />Link: <a href="http://remysharp.com/2007/12/28/jquery-tag-suggestion/">http://remysharp.com/2007/12/28/jquery-tag-suggestion/</a>    <br /><em><u>My Notes:</u>&#160; Good, simple.&#160; Slick auto-complete, but no spacing support.&#160; Older, not actively developed?</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marcmezzacca.com/2011/06/best-tag-editor-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ASP.NET MVC 3 Routes &#8211; Allow Arbitrary Number of Slashes With Catch All</title>
		<link>http://blog.marcmezzacca.com/2011/04/asp-net-mvc-3-routes-allow-arbitrary-number-of-slashes-with-catch-all/</link>
		<comments>http://blog.marcmezzacca.com/2011/04/asp-net-mvc-3-routes-allow-arbitrary-number-of-slashes-with-catch-all/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 11:46:06 +0000</pubDate>
		<dc:creator>marc</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[mvc3]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[routing]]></category>

		<guid isPermaLink="false">http://blog.marcmezzacca.com/2011/04/asp-net-mvc-3-routes-allow-arbitrary-number-of-slashes-with-catch-all/</guid>
		<description><![CDATA[I recently had issues where Google was seeing misspellings of a domain names as different websites themselves, and possibly as duplicate content.&#160; The domains were bound to the same web application in IIS and I wanted to fix this without editing the source of the web application itself.
I had a few options, one of which [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had issues where Google was seeing misspellings of a domain names as different websites themselves, and possibly as duplicate content.&#160; The domains were bound to the same web application in IIS and I wanted to fix this without editing the source of the web application itself.</p>
<p>I had a few options, one of which is to <a href="http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html" target="_blank">use Cantonal URLs</a>, but that would involve editing the web app to some degree.&#160; So before going that way, I wanted to start making permanent redirects to the correct website URL.&#160; The quickest approach I could think of was to create a global redirect as a new web application and reassign all the domain name bindings needed.&#160; So I created a simple MVC 3 Web Application called GlobalPermanentRedirect which effectively takes any page and redirects the path / query to domain specified in the appSettings. </p>
<p>The code is very simple, however I got stumped for a few minutes with Routing, as I forgot about the catch-all parameter using *.&#160; Here’s the code, it’s really only about three lines. </p>
<p>In the routing area (Global.ascx) register the route: </p>
<pre class="c-sharp" name="code">routes.MapRoute(
   &quot;Default&quot;, // Route name
   &quot;{*path}&quot;, // catch all urls
   new { controller = &quot;Redirect&quot;, action = &quot;Index&quot; } // Parameter defaults
);</pre>
<p>Create a controller called RedirectController.cs with the following line of code: </p>
<pre class="c-sharp" name="code">public ActionResult Index()
{
	return RedirectPermanent(ConfigurationManager.AppSettings[&quot;BaseUrl&quot;] + Request.Url.PathAndQuery.ToString());
}</pre>
<p>In web.Config under appSettings: </p>
<pre class="c-sharp" name="code">&lt;add value=&quot;http://www.yourmainsite.com&quot; key=&quot;BaseUrl&quot; /&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.marcmezzacca.com/2011/04/asp-net-mvc-3-routes-allow-arbitrary-number-of-slashes-with-catch-all/feed/</wfw:commentRss>
		<slash:comments>66</slash:comments>
		</item>
		<item>
		<title>Upgrade from ASP.NET MVC 1 to MVC 3</title>
		<link>http://blog.marcmezzacca.com/2011/03/upgrade-from-asp-net-mvc-1-to-mvc-3/</link>
		<comments>http://blog.marcmezzacca.com/2011/03/upgrade-from-asp-net-mvc-1-to-mvc-3/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 13:02:53 +0000</pubDate>
		<dc:creator>marc</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[mvc2]]></category>
		<category><![CDATA[mvc3]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.marcmezzacca.com/2011/03/upgrade-from-asp-net-mvc-1-to-mvc-3/</guid>
		<description><![CDATA[I came across the need to upgrade from MVC 1 to MVC 3, skipping MVC 2 altogether.&#160; Currently, it doesn’t seem like there are any formal directions coming from Microsoft.&#160; However, I found instructions mentioned in this StackOverflow question.
It appears, as of now, there is a two step process to migrate from MVC 1 to [...]]]></description>
			<content:encoded><![CDATA[<p>I came across the need to upgrade from MVC 1 to MVC 3, skipping MVC 2 altogether.&#160; Currently, it doesn’t seem like there are any formal directions coming from Microsoft.&#160; However, I found instructions mentioned in this <a href="http://stackoverflow.com/questions/5330500/is-it-possible-to-upgrade-an-mvc-1-project-to-mvc-3-and-use-the-razor-view-engine" target="_blank">StackOverflow question</a>.</p>
<p>It appears, as of now, there is a two step process to migrate from MVC 1 to MVC 3:    <br />1) Migrate from ASP.NET MVC 1 to MVC 2 (using <a href="http://weblogs.asp.net/leftslipper/archive/2010/03/10/migrating-asp-net-mvc-1-0-applications-to-asp-net-mvc-2-rtm.aspx" target="_blank">this tool</a>)     <br />2) Migrate from ASP.NET MVC 2 to MVC 3 (using <a href="http://aspnet.codeplex.com/releases/view/59008" target="_blank">this tool</a>)</p>
<p><strong>Things to be wary of…</strong></p>
<ul>
<li>ASP.NET MVC 3 Application Upgrade tool is not compatible with VS 2008 </li>
<li>It may compile, but <strong><em>jQuery version changes could still break your app on the client-side</em></strong> </li>
</ul>
<p>I haven&#8217;t tried it myself just yet.&#160; Based on what I’ve read, in theory, it should work, but there will likely be minor annoyances and issues to clean up.&#160; If it seems to work the first time, something is really wrong! <img src='http://blog.marcmezzacca.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I’ll post a follow-up once I give it a go.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marcmezzacca.com/2011/03/upgrade-from-asp-net-mvc-1-to-mvc-3/feed/</wfw:commentRss>
		<slash:comments>66</slash:comments>
		</item>
		<item>
		<title>Using Data Annotations and Extensions with SubSonic 3.0</title>
		<link>http://blog.marcmezzacca.com/2011/03/using-data-annotations-and-extensions-with-subsonic-3-0/</link>
		<comments>http://blog.marcmezzacca.com/2011/03/using-data-annotations-and-extensions-with-subsonic-3-0/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 23:39:40 +0000</pubDate>
		<dc:creator>marc</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[data annotation extensions]]></category>
		<category><![CDATA[data annotations]]></category>
		<category><![CDATA[subsonic]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://blog.marcmezzacca.com/2011/03/using-data-annotations-and-extensions-with-subsonic-3-0/</guid>
		<description><![CDATA[I was just about to search for a good Url regular expression to check input validation, when I remembered a recent blog post by @srkirkland mentioning Data Annotation Extensions (github).&#160; This extension package allows for additional common use data annotations, such as URL, Email, Credit Card, etc in any .NET 4.0 project. It has been [...]]]></description>
			<content:encoded><![CDATA[<p>I was just about to search for a good Url regular expression to check input validation, when I remembered a recent <a href="http://weblogs.asp.net/srkirkland/archive/2011/02/23/introducing-data-annotations-extensions.aspx" target="_blank">blog post</a> by <a href="http://twitter.com/srkirkland" rel="nofollow">@srkirkland</a> mentioning <a href="http://dataannotationsextensions.org/" target="_blank">Data Annotation Extensions</a> (<a href="https://github.com/srkirkland/DataAnnotationsExtensions" target="_blank">github</a>).&#160; This extension package allows for additional common use data annotations, such as URL, Email, Credit Card, etc in any .NET 4.0 project. It has been released as a NuGet package so you can easily implement it in your solution in just a click.</p>
<p>The catch was that I&#8217;m using SubSonic 3.0.&#160; I love SubSonic, but I couldn&#8217;t think of an easy way to implement Data Annotations in conjunction with it.&#160;&#160; So&#8230; I searched Stackoverflow like usual, and found a <a href="http://stackoverflow.com/questions/2321614/mvc-net-subsonic-auto-generate-metadata-classes-from-tt" target="_blank">couple good posts</a>.&#160; The short of it is to create an additional TT file that creates buddy classes. </p>
<p>Here is the walkthrough: <a title="http://subsonicproject.com/docs/User_talk:Minus4" href="http://subsonicproject.com/docs/User_talk:Minus4">http://subsonicproject.com/docs/User_talk:Minus4</a></p>
<p>Note that the MetaGenerator TT file referred to in the above post must be created manually by you and is not included with SubSonic by default.&#160; Actually you could call it whatever you like.&#160; The code is included in the posted link above.</p>
<p>In my MetaGenerator.TT (<a href="http://marcmezzacca.com/blog-files/MetaGenerator.tt.txt" target="_blank">download</a>) I added an extra line to the includes:</p>
<p>using DataAnnotationsExtensions;</p>
<p>Once saved, right click the file and select “Run Custom Tool” to generate the .cs (MetaGenerator.cs) file.&#160; Open that up and start adding your Data Annotations, and if you’ve so chosen, the Data Annotations Extensions as well.</p>
<p><a href="http://blog.marcmezzacca.com/wp-content/uploads/2011/03/3981c3cea7f7d772348901dc4b8d9ec0.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="3981c3cea7f7d772348901dc4b8d9ec0" border="0" alt="3981c3cea7f7d772348901dc4b8d9ec0" src="http://blog.marcmezzacca.com/wp-content/uploads/2011/03/3981c3cea7f7d772348901dc4b8d9ec0_thumb.png" width="450" height="87" /></a></p>
</p>
<p>I guess the only “gotcha” here is that if change your DB schema and you re-run the custom tool (TT file), it will wipe any custom input you’ve created.&#160; Perhaps there is a work around for that?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marcmezzacca.com/2011/03/using-data-annotations-and-extensions-with-subsonic-3-0/feed/</wfw:commentRss>
		<slash:comments>62</slash:comments>
		</item>
		<item>
		<title>Sending Amazon SES Emails through a Mock SMTP Server in .NET</title>
		<link>http://blog.marcmezzacca.com/2011/02/sending-amazon-ses-emails-through-a-mock-smtp-server-in-net/</link>
		<comments>http://blog.marcmezzacca.com/2011/02/sending-amazon-ses-emails-through-a-mock-smtp-server-in-net/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 14:39:26 +0000</pubDate>
		<dc:creator>marc</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[amazon ses]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[mock]]></category>
		<category><![CDATA[simple email service]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[smtp server]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://blog.marcmezzacca.com/2011/02/sending-amazon-ses-emails-through-a-mock-smtp-server-in-net/</guid>
		<description><![CDATA[Some have recently posted that a pitfall of the Amazon Simple Email Service is that you can&#8217;t setup it up to work through a traditional SMTP as you can with other services such as SendGrid.&#160; While Amazon SES doesn’t provide a SMTP wrapper, Amazon points out that it can be used with some modifications to [...]]]></description>
			<content:encoded><![CDATA[<p>Some have recently posted that a pitfall of the Amazon Simple Email Service is that you can&#8217;t setup it up to work through a traditional SMTP as you can with other services such as SendGrid.&#160; While Amazon SES <a href="http://www.aspnet101.com/2011/01/sending-email-asp-net-amazon-ses-simple-email-service/" target="_blank">doesn’t provide a SMTP wrapper</a>, Amazon points out that it can be used with some modifications to your existing MTA.&#160; From the Amazon Developer Docs: </p>
<blockquote><p><strong>Q: Can my existing SMTP applications deliver email via Amazon SES?</strong>       <br />Yes. The Amazon SES Developer Guide provides instructions for configuring common mail transfer agents (MTAs) to use Amazon SES as their email transport. By following these instructions, you can create a private SMTP relay for use with any existing SMTP client software. </p>
</blockquote>
<p>In looking at the <a href="http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/" target="_blank">Amazon SES Developer Guide</a>, they currently have examples of how to setup either <strong>Postfix</strong> or <strong>Sendmail</strong> software to use Amazon SES, and suggest adapting the examples to work with other agents. </p>
<p>If you want to test sending Amazon email in your own mock environment (or have an extreme situation that I don’t want to know about) below is how to setup a Mock SMTP Server and use it to test sending mail via local SMTP using the Amazon SES SendRawEmail API call. </p>
<p>There are a number of <a href="http://www.codeplex.com/site/search?query=smtp&amp;ac=8" target="_blank">open source Mock SMTP servers</a> available.&#160; For this demo I chose the <a href="http://antix.co.uk/Projects/SMTPImpostor" target="_blank">Antix Mail SMTP Impostor</a>.&#160; It seemed to have a good bit accomplished, while not being overly complex (brief <a href="http://leedumond.com/blog/a-better-smtp-development-server/" target="_blank">writeup here</a> by <a href="http://twitter.com/LeeDumond" rel="nofollow">@LeeDumond</a>).&#160;&#160; You can download the source code from here:&#160; <a title="http://ssfd.codeplex.com/" href="http://ssfd.codeplex.com/">http://ssfd.codeplex.com/</a></p>
<p>Once you’ve got the source code loaded up, Open FileMessageStorage.cs (in the Antix.Mail.Smtp.Impostor project).&#160; Add a reference to the Amazon .NET SDK. </p>
<p>Next find the <strong><em>Store()</em></strong> function.&#160; This function is used to store Mock emails locally on the hard drive.&#160; Insert the following code to actually send the email out via Amazon SES. </p>
<pre class="c-sharp" name="code">//Send msg via Amazon SES
AmazonSimpleEmailServiceClient client = new AmazonSimpleEmailServiceClient(&quot;accessKey&quot;, &quot;secretKey&quot;);
SendRawEmailRequest rawObj = new SendRawEmailRequest();
rawObj.RawMessage = GetRawMessageFromString(message.Data);
rawObj.Source = message.From.Address;
foreach (MailAddress addressTo in message.To)
{
	rawObj.Destinations.Add(addressTo.Address);
}
client.SendRawEmail(rawObj); </pre>
<p>Remember to include the namespaces</p>
<pre class="c-sharp" name="code">using Amazon.SimpleEmail.Model;
using Amazon.SimpleEmail;</pre>
<p>That&#8217;s it!&#160; Now you can create a sample Console App or even Outlook to use your localhost to test sending emails via local SMTP.&#160; I&#8217;m not sure if anyone would ever want to do this, but it was a fun exercise for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marcmezzacca.com/2011/02/sending-amazon-ses-emails-through-a-mock-smtp-server-in-net/feed/</wfw:commentRss>
		<slash:comments>184</slash:comments>
		</item>
		<item>
		<title>Using ASP.NET MVC Views to Send Email via Amazon Simple Email Service using Postal</title>
		<link>http://blog.marcmezzacca.com/2011/02/using-asp-net-mvc-views-to-send-email-via-amazon-simple-email-service-using-postal/</link>
		<comments>http://blog.marcmezzacca.com/2011/02/using-asp-net-mvc-views-to-send-email-via-amazon-simple-email-service-using-postal/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 15:30:31 +0000</pubDate>
		<dc:creator>marc</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[amazon ses]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[mvc3]]></category>
		<category><![CDATA[postal]]></category>
		<category><![CDATA[simple email service]]></category>
		<category><![CDATA[views]]></category>

		<guid isPermaLink="false">http://blog.marcmezzacca.com/2011/02/using-asp-net-mvc-views-to-send-email-via-amazon-simple-email-service-using-postal/</guid>
		<description><![CDATA[At the MvcConf 2 Andrew Davey (@andrewdavey) presented a neat emailing utility for ASP.NET MVC 3 called Postal that allows for using View Engines to ease the creation of email templates, and also takes care of sending the emails out.&#160; During the session someone raised the question about sending through third-party services, namely Amazon Simple [...]]]></description>
			<content:encoded><![CDATA[<p>At the <a href="http://www.mvcconf.com/" target="_blank">MvcConf 2</a> Andrew Davey (<a href="http://twitter.com/andrewdavey" rel="nofollow">@andrewdavey</a>) <a href="http://channel9.msdn.com/Series/mvcConf/mvcConf-2-Andrew-Davey-Going-Postal-Generating-email-with-View-Engines" target="_blank">presented</a> a neat emailing utility for ASP.NET MVC 3 called Postal that allows for <a href="http://aboutcode.net/2010/11/17/going-postal-generating-email-with-aspnet-mvc-view-engines.html" target="_blank">using View Engines</a> to ease the creation of email templates, and also takes care of sending the emails out.&#160; During the session someone raised the question about sending through third-party services, namely Amazon Simple Email Service.&#160; Since Postal relies on .NET&#8217;s SmtpMail, there wasn&#8217;t a straight forward solution.&#160; This following post is about a hack I built to get around this&#8230; until something better crops up.&#160; It&#8217;s certainly not the most efficient way, but it does work. </p>
<p><em>What You&#8217;ll Need</em></p>
<p><strong><a href="http://aboutcode.net/postal/" target="_blank">Postal</a></strong> &#8211; lets you create emails using regular MVC views.&#160; Use NuGet to get the package and get started instantly.</p>
<p><strong><a href="http://aws.amazon.com/ses/" target="_blank">Amazon Simple Email Service</a></strong> -&#160; a highly scalable and cost-effective bulk and transactional email-sending service for businesses and developers.&#160; Download and install the <a href="http://aws.amazon.com/sdkfornet/" target="_blank">Amazon SDK</a> and reference the DLL in your project.</p>
<p>Here&#8217;s what I hacked together for now which I just called MailExtensions:</p>
<p><strong>SendEmailBySES</strong> &#8211; Handles everything from the dynamic Postal view to sending the message via Amazon SES.</p>
<pre class="c-sharp" name="code">public static void SendEmailBySES(dynamic email) {
	//Create Amazon SES client instance
	AmazonSimpleEmailServiceClient client
		= new AmazonSimpleEmailServiceClient(&quot;accessKey&quot;, &quot;secretKey&quot;);
	//create postal service instance
	IEmailService service = new EmailService(ViewEngines.Engines);
	//create the mail message
	MailMessage msg = service.CreateMailMessage(email);
	//convert MailMessage object to Amazon SES SendEmailRequest object
	SendEmailRequest mailObj = ConvertFromMailMessage(msg);
	//Send the email via SES
	dynamic response = client.SendEmail(mailObj);
}</pre>
<p><strong>ConvertFromMailMessage</strong> &#8211; Converts a MailMessage object to an Amazon SES SendEmailRequest object.</p>
<p>The code for this is a bit longer and more hacky so just download it instead.&#160; <strong>You can </strong><a href="http://marcmezzacca.com/src/MailExtensions.cs.txt" target="_blank">download the source here</a><strong></strong><strong>.</strong></p>
<p>NOTE: If you aren’t setup with Amazon SES you’ll have to signup up, and then need to verify your email addresses initially and go through the sandbox.&#160; Then you’ll have to apply for production.&#160; Below is a snippet to verify your email address through the API:</p>
<pre class="c-sharp" name="code">public static void VeryifySESEmail(string addy)
{
	VerifyEmailAddressRequest verRequest = new VerifyEmailAddressRequest();
	verRequest.EmailAddress = addy;
	VerifyEmailAddressResponse verResponse = client.VerifyEmailAddress(verRequest);
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.marcmezzacca.com/2011/02/using-asp-net-mvc-views-to-send-email-via-amazon-simple-email-service-using-postal/feed/</wfw:commentRss>
		<slash:comments>71</slash:comments>
		</item>
	</channel>
</rss>

