I have this code. It prints "Message sent successfully" but I have no message from my test from in my inbox.
Here is HTML code:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Basic Email Form</title>
    <style>
        * {
            margin:0;
            padding:0;
        }
        input, textarea {
            margin:10px;
            font-family:Arial, sans-serif;
            padding:10px;
        }
        input {
            width:280px;
            height:40px;
        }
        textarea {
            width:280px;
            height:120px;
        }
    </style>
</head>
<body>
    <form action="submit.php" method="post">
        <input type="text" name="name" placeholder="Name" /><br />
        <input type="text" name="from" placeholder="Email" /><br />
        <textarea placeholder="Message" name="message"></textarea><br />
        <input type="submit" value="Submit" />
    </form>
<body>
</html>
PHP file:
<?php
   $to = "prefertodie@gmail.com";
   $subject = "This is subject";
   $message = "This is simple text message.";
   $header = "From:".$_POST['from']." \r\n";
   $retval = mail ($to,$subject,$message,$header);
   if( $retval == true )  
   {
      echo "Message sent successfully...";
   }
   else
   {
      echo "Message could not be sent...";
   }
?>
 
     
     
    