how to send email from web page in the most simple way with asp.net?
<p>In my web site I have "contuct us" page and I want the manager able to reply via email
to the customers.
All the process need to be in the server side.
It is important to note that I works with Webmatrix development environment...</p>

<p>So considering my web development what is the simple way for me to add the ability to 
send email? </p>

<p>My HTML code is:</p>

<pre><code>foreach(var row in db.Query(displayApplicant,nameOfcustomer))
                {
                &lt;tr&gt;
                    &lt;td class="dispExpertActScreen"&gt;@row.messegeID&lt;/td&gt;
                    &lt;td class="dispExpertActScreen"&gt;@row.name&lt;/td&gt;
                    &lt;td class="dispExpertActScreen"&gt;@row.email&lt;/td&gt;
                    &lt;td class="dispExpertActScreen"&gt;@row.isCustomer&lt;/td&gt;
                    &lt;td class="dispExpertActScreen"&gt;@row.userID&lt;/td&gt;
                    &lt;td class="dispExpertActScreen"&gt;@row.content&lt;/td&gt;
                    &lt;td class="dispExpertActScreen"&gt;&lt;a href="#" onclick="answerBox('@row.messegeID','@row.userID')" style="color: #b04e4e"&gt;answer the question&lt;/a&gt;&lt;/td&gt;
                    &lt;td class="dispExpertActScreen"&gt;&lt;a href="#" onclick="reqeustToDelete('@row.messegeID')" style="color: #b04e4e"&gt;remove&lt;/a&gt;&lt;/td&gt;
                &lt;/tr&gt;
                } 
</code></pre>

<p>the javascript function: (to save details in hidden fields)</p>

<pre><code>&lt;script type="text/javascript"&gt;

function answerBox(messegeID,userID) {
        var msg = prompt('answer to customer:');
        document.getElementById('answer').value = msg;
        document.getElementById('ansMode').value = 'true';
        document.getElementById('msgID').value = messegeID;
        document.getElementById('user').value = userID;
        document.getElementById('ansMessege').submit();
    }

&lt;/script&gt;
</code></pre>

<p>the hidden fields:</p>

<pre><code>&lt;form method="post" id="ansMessege" style="font-size: medium; margin-top: 10%" dir="rtl"&gt;
    &lt;input type="hidden" name="answer" id="answer" value=""&gt;
    &lt;input type="hidden" name="msgID" id="msgID" value=""&gt;
    &lt;input type="hidden" name="user" id="user" value=""&gt;
    &lt;input type="hidden" name="ansMode" id="ansMode" value=""&gt;
&lt;/form&gt; 
</code></pre>

<p>the asp.net code:</p>

<pre><code>&lt;%@ Import Namespace="System.Web.Mail" %&gt;

@{
    Layout = "~/_ManagerLayout.cshtml";
    Page.Title = "Management Applications";

 }
@{
    var db = Database.Open("MyProjectSite");
    var display="no";
    var displayApplicant="";
    var nameOfcustomer="";
    var category="";
    var yesNo="";
     if(IsPost)
    {
     if(Request.Form["ansMode"] == "true")
          {
              var selectQuery="SELECT * FROM messegesFromCustomers";
              var id=Request.Form["msgID"];
              var msg=Request.Form["answer"];
              var user=Request.Form["user"];

              foreach(var row in db.Query(selectQuery))
              {
                  if(row.messegeID == Convert.ToInt32(id))
                  {
                      if(row.isCustomer == "yes")// **send the messege to customer account**
                      {
                          var insertQuery="UPDATE messegesFromCustomers SET answer=@0 WHERE messegeID=@1";
                          db.Execute(insertQuery,msg,id);
                          Response.Write("&lt;script&gt;alert('your answer sent successfully');&lt;/script&gt;");
                          break;
                      }
                      else
                      {
                          // **Send messege to Occasional customer via email**
                         // **here I want to add code for sending email...**


                          string from = "ofirhgy@gmail.com";
                          string to = "ofirhgy@gmail.com";
                          string subject = "Hi!";
                          string body = "How are you?";
                          SmtpMail.SmtpServer = "mail.gmail.com";
                          SmtpMail.Send(from, to, subject, body);

                          break;
                      }
                  }
              }

          }

 }



}
</code></pre>

<p>As you see I try to use WebMail.Send(...) but I don't know how...
In addition to that I saw that someone wrote that there is need to add some code 
to the Web.config or something like that....</p>

<p>thanks you for help.</p>

<p>Edit:I edit the code and I put the line:</p>

<pre><code>&lt;%@ Import Namespace="System.Web.Mail" %&gt;
</code></pre>

<p>in the top of the asp.net page but I get this error:</p>

<p>Parser Error Message: A space or line break was encountered after the "@" character.  Only valid identifiers, keywords, comments, "(" and "{" are valid at the start of a code block and they must occur immediately following "@" with no space in between.</p>

<p>Can anybody place for me the exact code? </p>
