Stworzyłem stronę internetową korzystając z szablonu KLIK.
Jednak mam problem z formularzem kontaktowym. Treść mail handlera wygląda tak:
<?php //SMTP server settings $host = ""; $port = ""; $username = ""; $password = ""; $messageBody = ""; if($_POST['name']!='false'){ $messageBody .= '<p>Visitor: ' . $_POST["name"] . '</p>' . "\n"; $messageBody .= '<br>' . "\n"; } if($_POST['email']!='false'){ $messageBody .= '<p>Email Address: ' . $_POST['email'] . '</p>' . "\n"; $messageBody .= '<br>' . "\n"; }else{ $headers = ''; } if($_POST['phone']!='false'){ $messageBody .= '<p>Phone Number: ' . $_POST['phone'] . '</p>' . "\n"; $messageBody .= '<br>' . "\n"; } if($_POST['message']!='false'){ $messageBody .= '<p>Message: ' . $_POST['message'] . '</p>' . "\n"; } if($_POST["stripHTML"] == 'true'){ } if($host=="" or $username=="" or $password==""){ $owner_email = $_POST["owner_email"]; $headers = 'From:' . $_POST["email"] . "\r\n" . 'Content-Type: text/plain; charset=UTF-8' . "\r\n"; $subject = 'Wiadomość z formularza ' . $_POST["name"]; try{ throw new Exception('mail failed'); }else{ } }catch(Exception $e){ } }else{ require_once 'Mail.php'; $to = $_POST["owner_email"]; $subject = 'A message from your site visitor ' . $_POST["name"]; 'From' => 'From:' . $_POST["email"] . "\r\n" . 'Content-Type: text/plain; charset=UTF-8' . "\r\n", 'To' => $to, 'Subject' => $subject); 'smtp', array ( 'host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $messageBody); try{ if(PEAR::isError($mail)){ }else{ } }catch(Exception $mail){ } } ?>
Nie za bardzo wiem jak go uzupełnić, tj. na pewno nie chciał bym podawać w pierwszych polach danych konta mailowego z uwagi na bezpieczeństwo.
Czy ktoś może mi podpowiedzieć?