|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
PHP on windows - problem with script
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 |
|
#2
|
|||
|
|||
|
ive got the same problem in windows, i think the mail() is not supported on windows.
![]()
__________________
http://www.zeratool.com |
|
#3
|
||||
|
||||
|
you have to setup your own smtp server on windows for the mail script to run.
![]() |
|
#4
|
|||
|
|||
|
how do we have to change the script to get it working with a smtp account - and how will the log file work?
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Windows Help > PHP on windows - problem with script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|