HI
I am trying to send a mail from a html form. I am working with a localhost. I can't send the email but it doesn't show the error. What can I do to see the error? Thank you for your time.
<?php
if ($_POST['submit'])
{ $nume=$_POST['nume_exp'];
$mesaj=$_POST['mesaj'];
if ($nume && $mesaj)
{error_reporting(E_ALL);
ini_set('display_errors', true);
$to = 'cristina.horjea@yahoo.com'; // Adresa unde va fi trimis mesajul
$subiect = 'Mesaj de pe site';
$mesaj = $_POST['mesaj'];
$from = 'From: '. $_POST['mail_exp'];
if (@mail($to, $subiect, $mesaj, $from))
{ echo 'Mesajul a fost trimis cu succes.';
}
else { echo 'Eroare, mesajul nu a putut fi expediat.'; }
}
else die("Nu ati introdus valori in toate campurile");
}
?>
<form method="post" action="contact.php">
<table>
<tr>
<td>NUME:</td>
<td><input type="text" name="nume_exp" size="25"></td>
</tr>
<tr>
<td>PRENUME:</td>
<td><input type="text" name="prenume_exp" size="25"></td>
</tr>
<tr>
<td>ADRESA EMAIL:</td>
<td><input type="text" name="mail_exp" size="25"></td>
</tr>
<tr>
<td>MESAJ:</td>
<td><textarea name="mesaj" cols="25" rows="8"></textarea></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="reset" value="Anuleaza"/>
<input type="submit" name="submit" value="Trimite"/>
</td>
</tr>
</table>
</form>