-
spedire email con php
Salve a tutti,
ho il seguente problema, tramite il seguente codice devo mandare una mail al destinatario, il quale dovrebbe leggerla in html. ora io ho inserito negli headers la notifica, solo che mi arriva direttamente il codice html, senza essere stato interpretato.
Posto il codice:
Codice PHP:
$body = " ";
$body .='<html><head></head><body><form type="post" action="http://ricezione.altervista.org/ricezione.php" enctype="multipart/form-data">';
$body .='<input type="hidden" name="nome_cliente" value="'.$cliente.'" />';
$body .='<input type="hidden" name="cod_offerta" value="'.$cod_offerta.'" />';
$body .='<input type="text" name="nome_clientet" value="'.$cliente.'" />';
$body .='<input type="text" name="cod_offertat" value="'.$cod_offerta.'" />';
$body .='<input type="submit" /><input type="reset" /></form></body></html>';
$header = "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html; charset=iso-8859-1\r\n";
$header .= 'From: "frizzi" <fgiuffo@email.it> \r\n';
$header .= "Reply-to: simb@mioserver.it\r\n";
$to = 'hjds88@email.it';
$subject = "Registrazione effettuata con successo!";
$message = $body;
mail($to, $subject, $message, $headers)
Gentilmente sapete darmi una dritta??
grazie
-
Non funziona perché prima utilizzi la variabile $header, poi usi la $headers.
O le chiami entrambe header, o entrambe headers (o in generale puoi chiamarle come vuoi, però deve essere la stessa variabile!).
Ciao!