Jump to content

MailScript Failing


PhilipK

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.