title: wordpress wp_mail() function with jquery $.post()
body: <p>I'm building custom contact form on wordpress using jquery $.post() function.</p>
  
  <pre><code>$.post(tmpl_dir + '/bugreport.php',{ name:name, email:email, message:message }, function(data) {
                  if ( data ) alert( 'thanks for answer' )
                  else alert('error sending, please try again.');
  
              })
  </code></pre>
  
  <p>(tmlp_dir is theme directory path)</p>
  
  <p>here is bugreport.php file:</p>
  
  <pre><code>&lt;?php 
  if ( isset($_POST['name']) &amp;&amp; isset($_POST['email']) &amp;&amp;isset($_POST['message']) ) {
      $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message'];
      $send_to = "mail@mail.com";
      $subject = "Question from " . $name;
      $success = wp_mail($send_to,$subject,$message);
              if ($succsess) return true
              else return false;
  }
  ?&gt;
  </code></pre>
  
  <p>I'm getting an error from wordpress that says: wp_mail() function not defined.
  How can i let my php file use wp_mail() function?</p>
  
  <p>Thanks.</p>