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 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? 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? Link to comment https://forums.phpfreaks.com/topic/241891-mailscript-failing/#findComment-1242195 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.