Ciao,
ho un sito che risiede su aruba.
Ho creato un modulo contatti il quale invia l'email tramite il file contatti.php
Ecco il file contatti.php
codice:
<?php
// Website Contact Form Generator
// http://www.tele-pro.co.uk/scripts/contact_form/
// This script is free to use as long as you
// retain the credit link
// get posted data into local variables
$EmailFrom = "Sito Web";
$EmailTo = "miaemail@miaemail.com";
$Subject = "Email dal modulo ISCRIVITI";
$Nome = Trim(stripslashes($_POST['Nome']));
$Cognome = Trim(stripslashes($_POST['Cognome']));
$Email = Trim(stripslashes($_POST['Email']));
$Citta = Trim(stripslashes($_POST['Citta']));
$Provincia = Trim(stripslashes($_POST['Provincia']));
$Indirizzo = Trim(stripslashes($_POST['Indirizzo']));
$Telefono = Trim(stripslashes($_POST['Telefono']));
$Cellulare = Trim(stripslashes($_POST['Cellulare']));
$Messaggio = Trim(stripslashes($_POST['Messaggio']));
// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "Nome: ";
$Body .= $Nome;
$Body .= "\n";
$Body .= "\n";
$Body .= "Cognome: ";
$Body .= $Cognome;
$Body .= "\n";
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "\n";
$Body .= "Citta': ";
$Body .= $Citta;
$Body .= "\n";
$Body .= "\n";
$Body .= "Provincia: ";
$Body .= $Provincia;
$Body .= "\n";
$Body .= "\n";
$Body .= "Indirizzo: ";
$Body .= $Indirizzo;
$Body .= "\n";
$Body .= "\n";
$Body .= "Telefono: ";
$Body .= $Telefono;
$Body .= "\n";
$Body .= "\n";
$Body .= "Cellulare: ";
$Body .= $Cellulare;
$Body .= "\n";
$Body .= "\n";
$Body .= "Messaggio: ";
$Body .= $Messaggio;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
Questa il form nella pagina:
codice:
<form method="POST" action="contatti.php">
<table width="350" border="0" align="center" cellpadding="0" cellspacing="0" class="tab-contenuto">
<tr>
<td width="20%" height="30">Nome:</td>
<td width="80%">
<label>
<input type="text" name="Nome" class="campo">
</label>
</td>
</tr>
<tr>
<td height="30">Cognome:</td>
<td><label>
<input type="text" name="Cognome" class="campo">
</label></td>
</tr>
<tr>
<td height="30">Email:</td>
<td><input type="text" name="Email" class="campo"></td>
</tr>
<tr>
<td height="30">Città:</td>
<td><input type="text" name="Citta" class="campo"></td>
</tr>
<tr>
<td height="30">Provincia:</td>
<td><input type="text" name="Provincia" class="campo"></td>
</tr>
<tr>
<td height="30">Indirizzo:</td>
<td><input type="text" name="Indirizzo" class="campo"></td>
</tr>
<tr>
<td height="30">Telefono:</td>
<td><input type="text" name="Telefono" class="campo"></td>
</tr>
<tr>
<td height="30">Cellulare:</td>
<td><input type="text" name="Cellulare" class="campo"></td>
</tr>
<tr>
<td height="30">Messaggio:</td>
<td><textarea name="Messaggio" rows="5" class="campo"></textarea></td>
</tr>
<tr>
<td height="30"></td>
<td><label>
<input type="submit" name="submit" value="Invia" class="pulsante">
<input type="submit" name="Submit" value="Cancella" class="pulsante">
</label></td>
</tr>
</table></form>
Questo form funziona se inserisco la mia email.
Quando vado ad inserire la mia seconda email di Libero oppure l'email del cliente (la quale è stata creata con Gmail) il modulo non funziona più.
E' un codice poco affidabile?