PhilipK Posted July 13, 2011 Share Posted July 13, 2011 Hey everyone, I'm having trouble with a simple mail script. I will start with the jQuery which sends a post. $("#email").click(function () { var usersemail = $("#user-email").val() ; $.post("mailform.php", { message: 'feedback', email: 'usersemail' } ); }); }); Next is the php file mailform.php <?php //The email of the sender $email = $_POST['email']; //The message of the sender $message = $_POST['message']; //The subject of the email $subject = "Fanshawe Student Success"; $extra = $email."\r\nReply-To: ".$email."\r\n"; mail($email,$subject,$message,$extra); ?> Not sure why this isn't working? Here is a live version of the App if you would rather test it. http://philipk.ca/Interactive-survey/index.html and here is the php page. http://philipk.ca/Interactive-survey/scripts/mailform.php Quote Link to comment https://forums.phpfreaks.com/topic/241891-mailscript-failing/ Share on other sites More sharing options...
trq Posted July 13, 2011 Share Posted July 13, 2011 What debugging have you attempted? Quote Link to comment https://forums.phpfreaks.com/topic/241891-mailscript-failing/#findComment-1242191 Share on other sites More sharing options...
PhilipK Posted July 13, 2011 Author Share Posted July 13, 2011 I mainly just edit existing PHP files I have written and go through a trail and error attempts to get things working how I want them to. Are there methods for testing this kind of thing that I should learn? Quote Link to comment https://forums.phpfreaks.com/topic/241891-mailscript-failing/#findComment-1242195 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.