title: ASP.NET Razor Form Data not being passed to variables used in e-mail
body: <p>I'm just now experimenting with ASP.NET and Razor, I'm trying to take a simple HTML form and have it pass data to Variables on POST and use those variables to build a simple e-mail sent by SMTP. However it appears that the data is not being passed to these variables as when the e-mail is sent they are blank. If I hard-code values to these variables they get shown correctly. Here is a snippet of the code I'm working with. Ignore the localhost under WebMail.SmtpServer, I'm using SMTP4dev to test the e-mail functionality locally. This first section is the razor code:</p>
  
  <pre><code>@{
  var errorMessage = "";
  
  if (IsPost)
  {
  
      var fromEmail = "user@localhost";
      var body = Request["requestDate"];
      var requestorName = Request["requestorName"];
      var subject = requestorName;//( "IT Account Request for "+ @requestorName +" ." );
  
      try {
          WebMail.SmtpServer = "localhost";
          WebMail.SmtpPort = 25;
          WebMail.EnableSsl = false;
          WebMail.UserName = "user@localhost";
          WebMail.Password = "smtppassword";
          WebMail.From = fromEmail;
          WebMail.Send(to: "test@localhost",
              subject: subject,
              body: body
  
  
  
  
          );
      }
      catch (Exception ex ) {
          errorMessage = ex.Message;
      }
  }
  }
  &lt;div&gt;Error: @errorMessage &lt;/div&gt;
  &lt;form action="" method="post" enctype="text/plain"&gt;
      &lt;table id="requestor_information_form"&gt;
          &lt;tr&gt;
              &lt;td class="top"&gt;&lt;img src="images\logo.png"&gt;&lt;/img&gt;&lt;/td&gt;
              &lt;td class="top"&gt;Account Request&lt;/td&gt;
              &lt;td class="top" colspan ="2"&gt;&lt;/td&gt;
          &lt;/tr&gt;
  
          &lt;tr&gt;
              &lt;td class="tableHeading" colspan="4"&gt;Requestor Information&lt;/td&gt;
          &lt;/tr&gt;
  
          &lt;tr&gt;
              &lt;td&gt;Requestor:&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="requestorName"&gt;&lt;/td&gt;
  
              &lt;td&gt;Request Date:&lt;/td&gt;
              &lt;td&gt;&lt;input type="date" name="requestDate"&gt;&lt;/td&gt;
          &lt;/tr&gt;
  
          &lt;tr&gt;
              &lt;td&gt;Requestor Phone:&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="requestorPhoneNum"&gt;&lt;/td&gt;
                      &lt;/tr&gt;
    &lt;/form&gt;
  </code></pre>