Hi folks,
I´m just using this php code to send an email:
<?
function MailInfo($myemail){
global $name,$email,$fon,$email,$theme;
global $time,$date;
if(trim("$name") == "")
{ //Verifying input
echo "No name<BR>";
}
if(trim("$fon") == ""){ //Verifying input
echo "No phone entered.<BR>";
}
else
{
//now we mail both recipients only if a name is entered
$your_message = "
Information:\n
Name: $name
E-Mail: $email
Fon: $fon
Theme: $theme
PLZ-Ort: $time
DATE: $date\n";
//Make sure you replace this according to what you want
//the thank you message to say
echo "<B>Thanks </B>.";
$thank_you_message = "
Thank you!";
$extra_headers = "From: $email";
$extra_headers2 = "From: friend@service.ocm";
mail("$myemail","!!! Kontaktformular !!!","$your_message","$extra_headers");
//mail YOU the info
mail("$email","your message","$thank_you_message","$extra_headers2");
//mail thank you email
} //closes if else
}// closes function
function ShowResults ($name) {
MailInfo("sender@mail.com");//replace with your email
} # End of function ShowResults
// Define $data below with $variables you want to write.
// (ex. - $data = $email_address, $name, $phone_number, etc.)
// Make sure that the " " is surounding the variables.
$data = " ";
// You are saveing what is considered personal info, so name file w/ .php extention.
// That way if called direct from browser, it will spill an error and not show the contents.
$fhandle = fopen('path/to/file/log.php', "a");
fwrite ( $fhandle, $data );
fclose ( $fhandle );
// Make sure that the data file is CHMOD to 666 to be writable.
// Put this code at end of mail script.
function ShowForm() {
global $PHP_SELF;
?>
This script works perfectly on linux, but not on windows.
On loading the page you get this error for each variable:
Notice: Undefined variable: name in C:\web\com\mail.php on line 66
How do I have to modify the script that it sends the mails and writes the log?
thanks,
freeman