This was tested OK. I have it write the POST variables to text so I could test locally without actually firing the mail. Just drop the text writing from the PHP once you have your routine where you want it.
Code:
<?php
$ToName = "Josef van Niekerk";
$ToEmail = "...@...";
$FromName = "Mr.T";
$FromEmail = "...@...";
$Subject = $_POST['mysubject'];
$Message = "This is only a test!!! :)";
mail("$ToName <$ToEmail>", "$Subject", "$Message", "From: $FromName<$FromEmail>");
//this section writes a text file to confirm variables sent..remove if not needed
$test ="$ToName <$ToEmail>";
$test .="$Subject";
$test .="$Message";
$test .="From: $FromName<$FromEmail>";
$file= fopen("testmail.txt", "w");
fwrite($file, $test);
fclose($file);
?>
Attachment of FUN file below. You should really try to get yourself using the loadVars class. It's a lot more flexible.
I notice that when my variables inside the PHP script, for ex. mysubject has any capitals in it, it fails to work.
Use
$Subject = $_POST['mysubject'];
and not
$Subject = $_POST['mySubject'];
is this PHP convention?
Also, how do I remove the \ slashes before some special characters?
No sweat man. In your free time check out the loadVars class. It is much cooler , more flexible and is perfect when the response from your PHP file is needed in instances of confirmation or similar.