samedi 27 février 2016

Web page does not send an e-mail using PHP [duplicate]

This question already has an answer here:

I'm trying to make a web page that sends a message to a specific e-mail, in this example i used 'YourEmail@yahoo.com'. The problem is that when i click on the send button to send the e-mail, the email does not send. What am i doing wrong?

Note: contact.html is the webpage that has the text-boxes and buttons to send the e-mail.

<?php

 $message = "Name: ".$_POST["Name"]."\n";
 $message = "Email: ".$_POST["Email"]."\n";
 $message = "Phone: ".$_POST["Phone"]."\n";
 $message = "Message: ".$_POST["Message"];


mail('YourEmail@yahoo.com', 'Contact this place', $message, null,
  'noreply@egovinc.com');

?>

<!--Above code is in my header tag-->

<!--Below code is in my body tag-->

    <form class="required-form" action="contact.html" method="post" enctype="text/plain" >
        <ol class="forms">

              <li>              
              <label for="name"><em class="required">*</em> Name</label>
              <input type="text" name="Name " value="" class="required"><br>
              <br>
              </li>

              <li>
              <label for="email"><em class="required">*</em> Email</label>
              <input type="text" name="E-Mail " value="" class="required"><br>
              <br>
              </li>

              <li>
              <label for="phone">Phone</label>
              <input type="text" name="Phone " id="phone" />
              <br>
              </li>

            <li>
              <label for="message"><em class="required">*</em> Message</label>
              <textarea name="Message "  class="required" ></textarea>
            </li>

            <li>
              <input class="submit" type="submit" value="Send">
              <input class="resetbtn" type="reset" value="Reset"> 
            </li>

        </ol>
      </form>

enter image description here




Aucun commentaire:

Enregistrer un commentaire