0

This is php code:

    <form action="form.php" method="post" enctype="multipart/form-data">

        <h1 class="title">Contact</h1>

        <label></label>
        <input name="name" required="required" placeholder="Your Name">


        <label></label>
        <input name="email" type="email" required="required" placeholder="Your Email">


        <label></label>
        <textarea name="message" cols="20" rows="5" required="required" placeholder="Message"></textarea>


        <input id="cancel" name="cancel" value="Cancel" />

        <input id="submit" name="submit" type="submit" value="Submit">

    </form>

This is php code :

I have to set my email address but I cant receive the message. where is my coding wrong.

https://i.gyazo.com/c79a14dd8023b6a2f2ba4bddc85d19f9.png

ikramlim
  • 103
  • 1
  • 2
  • 12

1 Answers1

0

In from of Mail Function you need to set also e-mail address of sender not only the Name.

$headers = 'From: Jack Sparrow <jsparrow@blackpearl.com>' . PHP_EOL .
    'Reply-To: Jack Sparrow <jsparrow@blackpearl.com>' . PHP_EOL .
    'X-Mailer: PHP/' . phpversion();
mail($to,$subject,$message,$headers);
LTasty
  • 2,008
  • 14
  • 22