Help send mail!
Scris: Sâm Apr 30, 2011
Salut am urmatorul script si nu imi merge
Chiar nu stiu de unde vine eroare, adica nu primesc pe mail ce am trimis. Daca ma poate ajuta cineva sa-mi zica ce e gresit in codul de mai jos:
Chiar nu stiu de unde vine eroare, adica nu primesc pe mail ce am trimis. Daca ma poate ajuta cineva sa-mi zica ce e gresit in codul de mai jos:
Cod: Selectaţi tot
<?php
if ($action == "trimite"){
$to=$recipient;
$mess = "From: $name\n $message\n";
$mailheaders="Return-path: $name <$email>\n";
$mailheaders.="From: $name <$email>\n";
$mailheaders.="Reply-To: $email\n";
$sent=mail(trim($recipient), $subject, $mess, $mailheaders);
if($sent){echo"<FONT SIZE=2>Email-ul dvs. a fost trimis la <B>$recipient</B></FONT>";
}else{
echo"<h1>Email-ul nu a putut fi trimis!</h1>";}
}
if ($action == ""){
?>
<table width=100% border=0 cellspacing=0 cellpadding=0>
<tr>
<form name=mail method=post action="mesaj.php?action=trimite">
<td width=59>Numele tau:</td>
<td width=187>
<input type=text name=name>
</td>
</tr>
<tr>
<td width=59>Email-ul tau:</td>
<td width=187>
<input type=text name=email>
</td>
</tr>
<tr>
<td width=59>Email-ul destinatarului:</td>
<td width=187>
<input type=text name=recipient>
</td>
</tr><tr><td>Subiect:</td><td>
<input type=text name=subject></td></tr><tr>
<td width=59>Mesaj:</td>
<td width=187>
<textarea name=message cols=85 rows=15></textarea>
</td>
</tr>
<tr>
<td width=59></td>
<td>
<input type=submit name=submit value=trimite!>
</td>
</tr>
</form>
</table>
<?php
}
?>