Search code examples
c#asp.netrazoractionmailer.net

ActionMailer.Net Email Encoding


I am using the ActionMailer.Net package for ASP.Net MVC.

It seems like the email template isn't properly encoded.

Html tags are rendered as plain text, so in my email I receive content like this (snipped):

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="backgroundTable"> 

My view is called mymail.html.chstml so it should be encoded as HTML and not text, according to ActionMail.net documentation.

Why would it not be properly encoded?


Solution

  • I finally found the problem, and this is strange...

    When I run the project in Visual Studio 2012 - it works fine and the email is properly encoded.

    But when I open it in Visual Studio 2013 - the HTML tags are not properly encoded and rendered as plain text.

    When published to the live server it works perfectly.

    So, the solution is to use VS 2012 until we know WHY it breaks in 2013.