View Single Post
Old 01-31-2013, 08:46 AM   PM User | #5
JohnGalt
New to the CF scene

 
Join Date: Jan 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
JohnGalt is an unknown quantity at this point
This is what it looks like now:
PHP Code:
<script>
    $(
"#notify").click(function(){
        $.
ajax({
            
type"POST",
            
url"/.../sendEmail.php",
            
data"{ 'body': 'TEST', 'to': '...', 'from': '...', 'subject': 'Test' }",
            
dataType"text",
            
statusCode: {
                
404: function() {
                    $(
"#notify").html("Could not contact server.");
                },
                
500: function() {
                    $(
"#notify").html("A server-side error has occurred.");
                }
            },
            
error: function() {
                $(
"#notify").html("A problem has occurred.");
            },
            
success: function() {
                $(
"#notify").html("Success!");
            }
        });
        return 
false;
    });
</script> 
Still getting my Success-message. Still not receiving an email.
I have a feeling there's more to the error/success part, than I understand so far...

Any help would be greatly appreciated.

My sendEmail.php again:
PHP Code:
<?php

$mailTo 
$_POST['to'];
$mailFrom $_POST['from'];
$subject $_POST['subject'];
$message $_POST['body'];

            
mail($mailTo$subject$message"From: ".$mailFrom);
?>
I really don't get it.

Last edited by JohnGalt; 01-31-2013 at 08:49 AM..
JohnGalt is offline   Reply With Quote