The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Emailing Contact Form Data

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #239501
    Timothy Smith

    I am creating a simple form for on a non profit web page. I want the user/donor to be able to simply click send and have the site/form send an email to the non-profit. I do not want an email client open up on the users screen. I just want it to send an email behind the scenes.

    I was hoping to do this on a simple static web site (html/css/js). Every example I come across wants me to use some sort of php or other backend server.

    This is want I am currently using

      <form method="GET" action="mailto:[email protected]" enctype="text/plain">
        <input type="text" name="subject" />
        <input name="Name" />
        <input name="E-Mail Address" />
        <textarea name="Message"></textarea>
        <input type="submit" value="Send" />
        <input type="hidden" name="body" />

    var form = document.getElementsByTagName('form')[0];
    function contact(e) {
      // Prevent Default Form Submission
      var target = || e.srcElement;
      var i = 0;
      var message = '';
      // Loop Through All Input Fields
      for(i = 0; i < target.length; ++i) {
         // Check to make sure it's a value. Don't need to include Buttons
         if(target[i].type != 'text' && target[i].type != 'textarea') {
                // Skip to next input since this one doesn't match our rules
         // Add Input Name and value followed by a line break
         message += target[i].name + ': ' + target[i].value + "\r\n";
      // Modify the hidden body input field that is required for the mailto: scheme
      target.elements["body"].value = message;
      // Submit the form since we previously stopped it. May cause recursive loop in some browsers? Should research this.

    This works but opens an email client on the users side and obviously does not hide the mailto email address.

    Is there a better solution for this with say wordpress or ruby on rails without the need to use mandrill, email chimp, constant contact, etc?

    Is there a FREE custom solution to this… using a gmail account perhapses?

Viewing 1 post (of 1 total)
  • The forum ‘Other’ is closed to new topics and replies.