title: OctoberCMS Post Form
body: <p>My form:</p>
  
  <pre><code>&lt;form id="main-contact-form" name="contact-form" ata-request="onSend" data-request-success="alert('Message Sent')"&gt;
  </code></pre>
  
  <p>I cant seem to get a form to post; where do I place this file? Which file do I edit to make it send the form data fields to my email? I have already setup the backend mail settings:</p>
  
  <pre><code>function onSend()
  {
      // Collect input
      $name = post('name');
      $email = post('email');
      $message = post('message');
  
  
      // Submit form
      $to = System\Models\MailSettings::get('sender_email');
      $params = compact('name','email');
      Mail::sendTo($to, 'temp.website::mail.newrequest', $params);
      return true;
  }
  </code></pre>