ciao,
ho scaricato dal sito di html.it uno script php per inviare mail dal sito.
lo script è questo:
codice:
<?php
if (!file_exists("variables.php")) header("Location: install.php");
include("variables.php");
echo "<html><head><link rel=stylesheet href=$css type=text/css><title>Pravettoni s.a.s.</title></head><body>";
if (!$_POST['name']||!$_POST['text']||$_POST['name']==""||$_POST['text']=="") {
echo "<form action=email.php method=POST>Il tuo nome: <input name=name value=\"\">
";
if (!$check) echo "Eventualmente tua";
else echo "Tua";
echo " mail per risposte: <input name=mail2 maxlength=50>
Testo della mail:
<textarea name=text rows=10 cols=60 maxlength=200></textarea>
<input type=submit value=\"Invia l'e-mail\"></form>";
}
else {
if ($time&&file_exists("time.txt")) {
$file = fopen("time.txt","r+");
$last = fread($file,filesize("time.txt"));
fclose($file);
if (time()-$time<=$last) die("Non puoi inviare l'e-mail, il tempo necessario tra una e l'altra non è passato");
}
if (!preg_match("/^([a-z0-9_\.-])+@(([a-z0-9_-])+\.)+[a-z]{2,6}$/i", $mail2)) {
if ($check) die("L'indirizzo e-mail non è valido");
else $mail2='';
}
$texts = "Nome: $name\n\n";
$texts = "email: $mail2\n\n";
if ($mail) $text .= "E-mail: $mail2\n\n";
$texts .= "Testo: $text";
$headers = "From: $name";
if ($mail) $headers .= " <$mail2>";
mail($mail,"Mail da parte di $name",$texts,$headers) or die("Impossibile inviare l'e-mail");
echo "Mail inviata correttamente.
.";
if ($time) {
$file = fopen("time.txt","w");
fwrite($file,time());
fclose($file);
}
}
?>
</body></html>
la mail che mi arriva è questa:
vorrei che andasse a capo prima di "E-mail:"
grazie