Hey everyone, i'm trying to make a simple contact form that sends data to a php mailing script using ajax...
I can't get it to work, here's what i've got:
phpmailer.php
- <?php
- $emailTo = $_POST['emailTo'];
- $subject = $_POST['subject'];
- $message = $_POST['message'];
-
- mail($emailTo, $subject, $message);
- ?>
form.js
- $.post("control/php/sendemail.php",
- { emailTo: 'my@email.com', subject: email, message: message },
- function(data){
- alert('sent');
- }
- );
basically the post function is contained a $.('button").click() so that it is fired when the submit button is clicked. Firebug say that everythink was successful but the email just wont send!! Any ideas??