Buonasera, ho trovato in giro per google uno script per inviare mail da un form.
Il mio problema è questo: quando invio la mail vengono visualizzati tutti i campi tranne 4:
- Anno
- Kilometri
- Cilindrata
- Alimentazione
Come mai? I codici son tutti uguali e non vedo nessun errore a livello di parentesi o virgolette.
Il codice php utilizzato dal form Action è questo:
Codice PHP:
<?php// L'INDIRIZZO DEL DESTINATARIO DELLA MAIL
$to = "info@comproautoinrete24.it";
// IL SOGGETTO DELLA MAIL
$subject = "MESSAGGIO VENDI AUTO USATA";
// COSTRUZIONE DEL CORPO DEL MESSAGGIO
$body = "I tuoi dati signor Bruno:\n\n";
$body .= "nome: " . trim(stripslashes($_POST["nome"])) . "\n";
$body .= "cognome: " . trim(stripslashes($_POST["cognome"])) . "\n";
$body .= "email: " . trim(stripslashes($_POST["email"])) . "\n";
$body .= "telefono: " . trim(stripslashes($_POST["telefono"])) . "\n";
$body .= "marca: " . trim(stripslashes($_POST["marca"])) . "\n";
$body .= "modello: " . trim(stripslashes($_POST["modello"])) . "\n";
$body .= "anno: " . trim(stripslashes($_POST["anno"])) . "\n";
$body .= "kilometri: " . trim(stripslashes($_POST["kilometri"])) . "\n";
$body .= "cilindrata: " . trim(stripslashes($_POST["cilindrata"])) . "\n";
$body .= "alimentazione: " . trim(stripslashes($_POST["alimentazione"])) . "\n";
$body .= "difetti: " . trim(stripslashes($_POST["difetti"])) . "\n";
// INTESTAZIONI SUPPLEMENTARI
$headers = "From: info@comproautoinrete24.it";
// INVIO DELLA MAIL
if(@mail($to, $subject, $body, $headers)) {
// SE L'INOLTRO E' ANDATO A BUON FINE...
echo "La mail e' stata inoltrata con successo.";
} else {// ALTRIMENTI...
echo "Si sono verificati dei problemi nell'invio della mail.";
}
?>
Attendo risposte, buona serata