Title: Contact Form error 404
Last modified: August 30, 2016

---

# Contact Form error 404

 *  [Khadesa](https://wordpress.org/support/users/khadesa/)
 * (@khadesa)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/contact-form-error-404/)
 * Hey programming pals,
 * I am having trouble with what else, a contact form.
 * I have styled and placed in my own form, in my home-page.php, here is the code:
 *     ```
       <div class="formbox">
       <form action="contact_me.php" method="post" class="STYLE-NAME">
       <div class ="label">
       <input id="name" type="text" name="name" placeholder="Name" />
       </div>
       <div class ="label">
       <input id="phone"  type="text" name="phone" placeholder="Phone Number" />
       </div>
       <div class ="label">
       <input id="email" type="email" name="email" placeholder="Email" />
       </div>
       <div class ="label">
       <textarea id="message" name="message" placeholder="Message"></textarea>
       </div>
       <div class ="label">
       <span>&nbsp;</span>
       <input type="submit" class="button" value="connect" />
       </div>
       </form>
       </div>
       ```
   
 * And here is the corresponding contact_me.php:
 *     ```
       <?php
       // Check for empty fields
       if(empty($_POST['name'])  		||
          empty($_POST['email']) 		||
          empty($_POST['phone']) 		||
          empty($_POST['message'])	||
          !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
          {
       	echo "No arguments Provided!";
       	return false;
          }
   
       $name = $_POST['name'];
       $email_address = $_POST['email'];
       $phone = $_POST['phone'];
       $message = $_POST['message'];
   
       // Create the email and send the message
       $to = 'a.moses.mosaic@gmail.com'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to.
       $email_subject = "Website Contact Form:  $name";
       $email_body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nName: $name\n\nEmail: $email_address\n\nPhone: $phone\n\nMessage:\n$message";
       $headers = "From: noreply@yourdomain.com\n"; // This is the email address the generated message will be from. We recommend using something like noreply@yourdomain.com.
       $headers .= "Reply-To: $email_address";
       mail($to,$email_subject,$email_body,$headers);
       return true;
       ?>
       ```
   
 * Any idea’s why this is not sending mail?
 * Thanks!

The topic ‘Contact Form error 404’ is closed to new replies.

## Tags

 * [contact-form](https://wordpress.org/support/topic-tag/contact-form/)
 * [mail](https://wordpress.org/support/topic-tag/mail/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [submit](https://wordpress.org/support/topic-tag/submit/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Khadesa](https://wordpress.org/support/users/khadesa/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/contact-form-error-404/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
