Jump to content

Contact Form - Not Send / receiving email


Barny74
Go to solution Solved by Barny74,

Recommended Posts

I have coded a contact form , but for some reason I am not actually getting the email , but the php code has no errors and the form returns a success message. I have removed my email address from the code here. Appreciate any help.

 

 

Contact form

<body>
<div class='formbody'>

<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>

<form id="contact-form" action="send.php" method="POST">

  <p>Hi</p>
  <p>My
    <label for="your-name">name</label> is
    <input type="text" name="your-name" id="your-name" minlength="3" placeholder="(your name here)" required> and</p>

  <p>my
    <label for="email">email address</label> is
    <input type="email" name="your-email" id="email" placeholder="(your email address)" required>
  </p>

  <p> I have a
    <label for="your-message">message</label> for you,</p>

  <p>
    <textarea name="your-message" id="your-message" placeholder="(your msg here)" class="expanding" required></textarea>
  </p>
  <p>
    <button type="submit">
      <svg version="1.1" class="send-icn" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="100px" height="36px" viewBox="0 0 100 36" enable-background="new 0 0 100 36" xml:space="preserve">
        <path d="M100,0L100,0 M23.8,7.1L100,0L40.9,36l-4.7-7.5L22,34.8l-4-11L0,30.5L16.4,8.7l5.4,15L23,7L23.8,7.1z M16.8,20.4l-1.5-4.3
    l-5.1,6.7L16.8,20.4z M34.4,25.4l-8.1-13.1L25,29.6L34.4,25.4z M35.2,13.2l8.1,13.1L70,9.9L35.2,13.2z" />
      </svg>
      <small>SEND PLEASE</small>
    </button>
  </p>
</form>
    <script src="assets/js/jquery.min.js"></script>
    <script src="assets/bootstrap/js/bootstrap.min.js"></script>
    <script src="assets/js/bs-animation.js"></script>
     <script src="assets/js/index.js"></script>
    </div>
</body>
</html>

Send.php

    <?php 
$page='contactus';
include('header.php');
include('navbar.php');

?>

<?php
$to = 'removed';
$name = TRIM (stripslashes($_POST['your-name']));
$email = TRIM (stripslashes($_POST['your-email']));
$message = TRIM (stripslashes($_POST['your-message']));
$subject = 'Message';


$name = 'Name: ';
$email= 'From:';
$message= 'Message: ';





if( mail($to, $subject, $name , $email , $message) ){
        echo 'success';

}

else{

    print('There has been a small error . Sorry!!');
}

?>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.