hi,
i having some problems sending email, already try in diferents servers and some works without problems and others... just don't send :queasy:
anyone can tell me why this code don't work?!
where is the problem....?! 😕
thanks in advance.
#!/usr/local/bin/php
<?php
$to="nelson@estud.com";
if (!isset($_POST["send"])){
// no post data -> display form
?>
<form method="POST" action="<?=$_SERVER['PHP_SELF'];?>">
To: nelson@estud.com<br>
From: <input type="text" name="sender">
<br>
Subject :
<input type="text" name="subject">
<br>
Message :<br>
<textarea name="message" rows="10" cols="60" lines="20"></textarea>
<br>
<input type="submit" name="send" value="Send">
</form>
<?
}else{
// found post data .. deal with it
$from=$_POST['sender'];
// send mail :
if (mail($to,$_POST['subject'],$_POST['message'],"From: $from\n")){
// display confirmation message if mail sent successfully
echo "Your mail was indeed sent to $to.";
}else{
// sending failed, display error message
echo "Doh! Your mail could not be sent.";
}
}
?>