title: sending mail from apache tomcat
body: <p>I am working on a web project using Tomcat 6 as my webserver and JSP as frontend. I want to send a mail from the web server to an email account. How can I achieve this?</p>
  
  <p>To start, here is my form in JSP:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form name="forgotpassword" onsubmit="return valid()"&gt;    
    &lt;table&gt;
      &lt;tr&gt;
        &lt;td&gt;Enter Employee ID&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" name="emp_id" size="50"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Enter Your Email Address&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" name="mailid" size="50"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;input type="submit"style="margin-left:100px" name="forgot" value="SUBMIT"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;input type="reset" name="cancel" value="RESET"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>