i sent a email using the following cord.
<?php
$to=$_POST["to"];//to=udara99@gmail.com
$from=$_POST["from"];//from=udara77@yahoo.com
$subject=$_POST["sub"];
$message=$_POST["msg"];
$headers="from: " .$from ."\r\n";
$mailsent=mail($to,$subject,$message,$headers);
if($mailsent){
echo "Congratulation the mail has been sent<br>";
echo "<b>To :<b> $to<br>";
echo "<b>From :<b> $from<br>";
echo "<b>Subject :<b> $subject<br>";
echo("<b>message :<b> <br>");
echo("$message");
}else
echo("the mail not sent");
?>
this code output in a way that email has been sent,but actually it has not been sent.
im using localhost.
dont know y>
sending mail
Moderator: General Moderators
Re: sending mail
It looks fine. My best guess is that mail is really sent, but it ends somewhere along with the spam messages (look into spam folder on yahoo). When you are sending using mail() function, be sure to define all the significant headers (at least from, to, subject, date), this increases the chance your message will pass the mail filters.