Stie cineva ce este gresit aici?
https://marplo.net/php-mysql/email_c ... ament.html
Cod: Selectaţi tot
<?php
function send_mail($to, $from, $from_name, $sub, $msg){
$eol = "\r\n";
$headers = "From: " . $from_name . "<" . $from . ">".$eol;
$headers .= "MIME-Version: 1.0" . $eol;
$headers .= "Content-type: text/html; charset=iso-8859-1" . $eol;
if (mail($to, stripslashes($sub), stripslashes($msg), $headers))
return 'Mesajul a fost trimis cu succes';
else return 'Eroare: mesajul nu a putut fi expediat';
}
$to = $_POST['to'];
$from = $_POST['from'];
$from_name = $_POST['from_name'];
$sub = $_POST['sub'];
$msg = $_POST['msg'];
$go_mail = send_mail($to, $from, $from_name, $sub, $msg);
echo $go_mail;
?>
<form action="/mail.php" method="post">
<table>
<tr><td>Mail-ul tau:</td><td><input type="text" name="to" id="to" maxlength="40"></td></tr>
<tr><td>Mail-ul lui:</td><td><input type="text" name="from" id="from" maxlength="40"></td></tr>
<tr><td>Numele lui:</td><td><input type="text" name="from_name" id="from_name" maxlength="40"></td></tr>
<tr><td>Subiect:</td><td><input type="text" name="sub" id="sub" maxlength="40"></td></tr>
<tr><td>Mesaj:</td><td><textarea name="msg" id="msg" maxlength="500"></textarea></td></tr>
<tr><td></td><td><br /><input type="submit" name="submit" value="Trimite" class="button" /></td></tr>
</table>
</form>
Asa apare fara sa apas pe vreun buton sau ceva. Dak completez formularul si il trimit nu se intampla nimic. Scriptul este cel de sus postat de mine, l-am mai modificat eu k erau mai multe erori pe site.