Scusate la mia poca esperienza in php ma sarei molto felice di ricevere un'aiuto!!!
sto creando un form in html che invia i dati ad una pagina php che poi invierà i dati dell'utente a destinatario
tutto ok solamente ho dei problemi con l'header.
In pratica vorrei che il mio cliente riceva l'email dell'utente con l'indirizzo email in intestazione, in modo da poter rispondere immediatamente, come se ricevessi una mail normalissima da un'amico
questo è lo script che gestisce l'invio sapreste dirmi come posso fare?
perchè a me arriva un'indirizzo molto strano
<?php
// L'INDIRIZZO DEL DESTINATARIO DELLA MAIL
$to = "email destinatario";
$em .= "Nome: " . trim(stripslashes($_POST["email"])) . "\n";
// IL SOGGETTO DELLA MAIL
$subject = "Modulo dal sito";
$headers = "credo che il codice vada inserito quà";
// COSTRUZIONE DEL CORPO DEL MESSAGGIO
$body = "Contenuto del modulo:\n\n";
$body = "Dati utente:\n\n";
$body .= "Nome: " . trim(stripslashes($_POST["nome"])) . "\n";
$body .= "Cognome: " . trim(stripslashes($_POST["cognome"])) . "\n";
$body .= "Indirizzo: " . trim(stripslashes($_POST["indirizzo"])) . "\n";
$body .= "Città: " . trim(stripslashes($_POST["citta"])) . "\n";
$body .= "Prefisso: " . trim(stripslashes($_POST["code_tel"])) . "\n";
$body .= "Numero telefono: " . trim(stripslashes($_POST["telefono"])) . "\n";
$body .= "Numero fax: " . trim(stripslashes($_POST["fax"])) . "\n";
$body .= "Testo: " . trim(stripslashes($_POST["testo"])) . "\n";
$body .= "Email: " . trim(stripslashes($_POST["email"])) . "\n";
$body .= "Auto: " . trim(stripslashes($_POST["auto"])) . "\n";
$body .= "Mese: " . trim(stripslashes($_POST["mese"])) . "\n";
$body .= "Giorno: " . trim(stripslashes($_POST["giorno"])) . "\n";
$body .= "Anno: " . trim(stripslashes($_POST["anno"])) . "\n";
$body .= "Numero notti: " . trim(stripslashes($_POST["numero_notti"])) . "\n";
$body .= "Numero persone: " . trim(stripslashes($_POST["numero_persone"])) . "\n";
$body .= "Numero camere: " . trim(stripslashes($_POST["numero_camere"])) . "\n";
// INTESTAZIONI SUPPLEMENTARI
// INVIO DELLA MAIL
if(@mail($to, $subject, $body)) { // SE L'INOLTRO E' ANDATO A BUON FINE...
echo "La mail è stata inoltrata con successo.";
echo "<SCRIPT>";
echo "location.href='prezzi.html'";
echo "</SCRIPT>";
} else {// ALTRIMENTI...
echo "Si sono verificati dei problemi nell'invio della mail.";
}
?>