Formularz nie wysyła mi wiadomości ze strony na e-mail. Proszę o pomoc w rozwiązaniu problemu. Próbowałem coś zmajstrować ,ale bez udanego rezultatu. Poniżej kod:
<?php if($_POST['submit']) { { $error = true; } else { $to = "lukaszkoteluk@gmail.com"; // $information = trim($_POST['information']); $temat = "Formularz kontaktowy"; $messages = "Imię i nazwisko: $name \r\n E-mail: $email \r\n Temat: $subject \r\n Wiadomość: $message"; $headers = "Wiadomość od: . $name"; if($mailsent) { $sent = true; } } } ?> <!DOCTYPE html> <html lang="pl"> <head> <meta charset="utf-8" /> <title>CompandCare</title> <link rel="stylesheet" href="main.css" type="text/css"> <link rel="stylesheet" href="grid.css" type="text/css" media="all"> </head> <body id="index" class="home"> <header id="banner" class="body"> <img src="images/logo.png" alt="CompandCare"/> <nav> <ul> <li><a href="index.html">home</a></li> <li><a href="usługi.html">usługi</a></li> <li class="active"><a href="kontakt1.php">kontakt</a></li> </ul> </nav> </header><!-- banner --> <footer id="contentinfo" class="body"> <address id="about" class="vcard author"> <div class="bottom"> <div class="container"> <div class="clearfix"> <div class="grid3 first"> <h3>Kontakt</h3> <div class="wrapper"> <dl class="address"> <dd><span>Telefon kom.:</span>600090437</dd> <dd><span>E-mail:</span><a href="lukaszkoteluk@gmail.com">lukaszkoteluk@gmail.com</a></dd> </dl> </div> </div> <div class="grid6"> <h3>Formularz kontaktowy</h3> <?php if($error == TRUE) { ?> <p class="error">Nie wypełniłeś wszystkich pól w formularzu. Wypełnij pozostałe pola.</p> <?php } if ($sent == TRUE) { ?> <p class="sent">Dziękujemy. Twój e-mail został wysłany prawidłowo. Odpowiemy na niego w przeciągu 24 godzin.</p> <?php } ?> <fieldset> <div class="grid3 first"> <label for="name">Imię i nazwisko:<br /> <input type="text" name="name" /> </label> <label for="email">E-mail:<br /> <input type="email" name="email" /> </label> <label for="subject">Temat:<br /> <input type="text" name="subject" /> </label> <label for="information">Skąd o nas wiesz:<br /> <select> <option value="z sieci Web">Z sieci Web</option> <option value="ulotki/ogłoszenia">ulotki/ogłoszenia</option> <option value="od znajomego">od znajomego</option> </select> </label> </div> <div class="grid3">Wiadomość:<br /> <textarea name="message"></textarea> <input type="submit" name="submit" class="submit" value="Wyślij" /> <div class="alignright"> <!-- <a href="" class="alt" onClick="document.getElementById('contacts-form').reset();">Wyczyść</a> <a href="#" class="alt" onClick="document.getElementById('contacts-form').submit(); ">Wyślij</a> <!-- <noscript> <input type="submit" value="Wyślij" style="border: none; background-color: transparent; text-decoration: underline; </noscript> --> </div> </div> </fieldset> </form> </div> </div> </div> </div> <!--<span class="bio"></span>--> </address> <p>Copyright 2012 Comp&Care<br>All Rights Reserverd.</p> </footer><!-- /#contentinfo --> </body> </html>