I want to send mail using php mail() function. but it is not working. tell me the mistake in code?if any correction in php.ini file should be there then also tell that.
here is my code:-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
if($_POST['submit'])
{
$subject = $_POST['subject'];
$to = $_POST['receiver'];
$message = $_POST['body'];
$sentmail = mail($to, $subject, $message);
if($sentmail == 'true')
{
echo 'Email successfully sent';
}
else
{
echo 'Email is not successfully sent';
}
}
else
{
?>
<form action="mail_trial3.php" method="POST">
Enter the Receiver email ID:-
<input type="text" name="receiver" /><br /><br />
Enter the subject:-
<input type="text" name="subject" /><br /><br />
Enter the message body:-
<input type="text" name="body" /><br /><br />
<input type="submit" value="Send the mail" name='submit'/>
</form>
<?php
}
?>
</body>
</html>