title: Send email confirmation through JavaScript/HTML?
body: <p>I want an email to be sent to users that register on my app (just a test app) to which they will receive an email of confirmation. </p>
  
  <p>I am not quite sure how to go about this but I would have thought that I would need to implement some javascript within the register function?</p>
  
  <p>I have posted my JavaScript and HTML code that is involved in the registration process, so I would much appreciate any assistance here. </p>
  
  <p>(Using HTML, JavaScript, Phonegap, JQueryMobile)</p>
  
  <p>Thanks. </p>
  
  <p>HTML - </p>
  
  <pre><code> &lt;form onsubmit="registerUser(); return false;"&gt;
          &lt;label for="txtusername"&gt;Username&lt;/label&gt;
          &lt;input type="text" id="txtusername"&gt;   &lt;input type="submit" value="Check Availability" data-mini="true" onclick="return CheckUser()"&gt;
          &lt;br&gt;
          &lt;label for="txtfirstname"&gt;First Name&lt;/label&gt;
          &lt;input type="text" id="txtfirstname"&gt;
          &lt;label for="txtlastname"&gt;Surname&lt;/label&gt;
          &lt;input type="text" id="txtlastname" &gt;
          &lt;label for="txtemail"&gt;Email&lt;/label&gt;
          &lt;input type="email" id="txtemail" &gt;
          &lt;label for="txtpassword"&gt;Password&lt;/label&gt;
          &lt;input type="password" id="txtpassword" &gt;
          &lt;label for="passwordconfirm"&gt;Confirm Password&lt;/label&gt;
          &lt;input type="password" id="passwordconfirm" &gt;
          &lt;input type="submit" value="Register User"&gt;
          &lt;input type="submit" value="Delete" onclick="return DeleteUser()"&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>JavaScript - </p>
  
  <pre><code> function registerUser() {
         var Username = document.getElementById("txtusername").value;
         var Firstname = document.getElementById("txtfirstname").value;
         var Lastname = document.getElementById("txtlastname").value;
         var Email = document.getElementById("txtemail").value;
         var Password = document.getElementById("txtpassword").value;
         var Confirmpass = document.getElementById("passwordconfirm").value;
  
           db = window.openDatabase("SoccerEarth", "2.0", "SoccerEarthDB", 2*1024*1024);
           db.transaction(function(tx) {
            NewUser(tx, Username, Firstname, Lastname, Email, Password, Confirmpass);
            }, errorRegistration, successRegistration);
            }
  
            function NewUser(tx, Username, Firstname, Lastname, Email, Password, Confirmpass) {
            var _Query = ("INSERT INTO SoccerEarth(UserName, FirstName, LastName, Email, Password, CPass) values ('"+ Username +"','"+ Firstname +"','"+ Lastname +"','"+ Email +"', '"+ Password +"', '"+ Confirmpass +"')");
             alert(_Query);
             tx.executeSql(_Query);
             }
             function errorRegistration(error) {
          navigator.notification.alert(error, null, "Got an error mate", "cool");
              }
             function successRegistration() {
             navigator.notification.alert("User data has been registered", null, "Information", "ok");
               $( ":mobile-pagecontainer" ).pagecontainer( "change", "#page4" );
           }
  </code></pre>