Salve a tutti
sono nuovo del forum e vorrei esporvi il mio problema. Ho un form su una pagina html:
Ho creato un file php dal nome mail.php:codice:<div id="contactform"> <h2>Why Not Contact Us Today !</h2> <form action="mail.php" method="post"> <fieldset> <legend>Contact Form</legend> <label for="fullname">Name: <input id="fullname" name="fullname" type="text" value="" /> </label> <label for="email" class="margin">Email: <input id="email" name="email" type="text" value="" /> </label> <label for="phone">Telephone: <input id="phone" name="phone" type="text" value="" /> </label> <label for="subject" class="margin">Subject: <input id="subject" name="subject" type="text" value="" /> </label> <label for="message">Message: <textarea id="message" name="message" cols="80" rows="8"></textarea> </label> <input id="submitform" name="submitform" type="submit" value="Submit" /> <input id="resetform" name="resetform" type="reset" value="Reset" /> </p> </fieldset> </form> </div>
Quando inserisco i dati nel form e mando l'invia m da sempre errore. Qualcuno può dirmi dove sbaglio ??codice:<?php // L'INDIRIZZO DEL DESTINATARIO DELLA MAIL $to = "sappy88@hotmail.com"; // IL SOGGETTO DELLA MAIL $subject = "Modulo proveniente dal sito www.altavaldiforfora.it"; // COSTRUZIONE DEL CORPO DEL MESSAGGIO $body = "Contenuto del modulo:\n\n"; $body .= "Dati personali ; Dati: " . trim(stripslashes($_POST["fullname"])) . "\n"; $body .= "Email: " . trim(stripslashes($_POST["email"])) . "\n"; $body .= "Telefono: " . trim(stripslashes($_POST["phone"])) . "\n"; $body .= "Oggetto: " . trim(stripslashes($_POST["subject"])) . "\n"; $body .= "Testo: " . trim(stripslashes($_POST["message"])) . "\n"; // INTESTAZIONI SUPPLEMENTARI $headers = "From: Modulo utenti www.altavaldiforfora.it"; // INVIO DELLA MAIL if(@mail($to, $subject, $body, $headers)) { // SE L'INOLTRO E' ANDATO A BUON FINE... echo "La mail è stata inoltrata con successo."; } else {// ALTRIMENTI... echo "Si sono verificati dei problemi nell'invio della mail."; } ?>
Grazie mille

Rispondi quotando