Html contact form and php - php

I'm going to post my html form and my php and hopefully someone can help me make them actually work. My agenda is to make what the user inputs into the html be sent to my email, and also for them to receive an email back saying that we got their email.
I also wanted for the user to be send to a "thank you we got your email" page after hitting submit. The html is kind of long so forgive me for that.
<!-- contact --->
<div class="templatemo_caption">
<div class="clear"></div>
<p>Create any task you would like.</p>
<div class="clear">
</div>
<div align="center">
<div class="container">
<div class="row">
<div class="col-md-3">
<form action="sendmail.php" method="POST">
<form role="form">
<div class="form-group">
<input name="name" type="text" class="form-control" id="name" placeholder="Your Name" maxlength="30">
</div>
<div class="form-group">
<input name="email" type="text" class="form-control" id="email" placeholder="Your Email" maxlength="30">
</div>
<div class="form-group">
<input name="subject" type="text" class="form-control" id="subject" placeholder="Your Task" maxlength="40">
</div>
<br /> <br />
<input type="submit" value="Send Feedback" />
</div>
<div class="col-md-9">
<div class="txtarea">
<textarea name="subject" rows="10" class="form-control" id="subject"> Any specific details we need to know?</textarea>
</div>
</form>
</form>
</div>
</div>
</div>
<!--Contact End-->
AND THE PHP LOOKS LIKE THIS
<?php
/* Subject and email variables */
$emailsSubject = 'This is where you type what you subject will show up as';
$webMaster = 'chelsieoverbay#yahoo.com';
/* Gathering Data Variables - Whats in the form */
$name = $_POST ['name'];
$email = $_POST ['email'];
$subject = $_POST ['subject'];
$msg = $_POST['msg'];
/*Security*/
/* What You Want To See In The Email Place Inbetween $body = <<<EOD and EOD; */
$body = <<<EOD
<strong>Client:</strong> $name
<br />
<br />
<strong>Email:</strong> $email
<br />
<br />
<strong>Subject:</strong> $subject
<br />
<br />
______________________________________________
<br />
<br />
$msg
EOD;
/* Headers is a tag containing the users email and how you want it to display in your email */
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
/* This is what sends the email */
$success = mail($webMaster, $emailsSubject, $body, $headers);
/* Results Rendered as Html */
echo file_get_contents("studenthome.nku.edu/~overbayc1/onlinebutler/submit.html");
?>

Here's an example of how you could send two messages, one to your recipent and one to yourself.
//MESSAGE TO RECIEPENT ************************************************/
// multiple recipients
$to = $_POST["email"];
// subject
$subject = 'Your mail has been recieved';
// message
$message = '
<html>
<head>
<title>Your mail has been recieved</title>
</head>
<body style="margin: 0px;">
<p style="margin-bottom: 35px;">Dear '.$_POST["name"].',</p>
<p style="margin-bottom: 5px;">
Your email with the subject: '.$con_subject.' has been recived, you will be answered as soon as possible, possibly within the last 5 days.
</p>
<p>
- AthaxDesigns
</p>
</body>
</html>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: '.$_POST["email"] . "\r\n";
$headers .= 'From: AthaxDesigns <noreply#athaxdesigns.com>' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
//MESSAGE TO MYSELF ************************************************/
// multiple recipients
$to = "support#athaxdesigns.com";
// subject
$subject = 'You have recieved an mail from '.$_POST["name"].' Subject: '.$con_subject.' ';
// message
$message = '
<html>
<head>
<title>You have recieved an mail from '.$_POST["name"].'</title>
</head>
<body style="margin: 0px;">
<p style="margin-bottom: 35px;">Name: '.$_POST["name"].' Email: '.$_POST["email"].',</p>
<p style="margin-bottom: 5px;">
'.$_POST["subject"].'
</p>
<p style="margin-bottom: 5px;">
'.$_POST["content"].'
</p>
</body>
</html>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: ' . $to . "\r\n";
$headers .= 'From: '.$_POST["name"].' <'.$to.'> '. "\r\n";
$headers .= 'Reply-To: ' . "\r\n" .
// Mail it
mail($to, $subject, $message, $headers);

Related

Trying to link a form and php file together. Not getting an email. What am I doing wrong?

<div class="col-lg-12 col-md-12 offset-lg-1">
<div class="impl_con_form">
<div class="col-lg-12 col-md-12">
<h1>get in touch</h1>
</div>
<form action="sendmail.php" method="POST" class="contact-form" novalidate="novalidate">
<div class="col-lg-12 col-md-12">
<div class="form-group">
<input type="text" name="first_name" class="form-control require" placeholder="YOUR NAME">
</div>
</div>
<div class="col-lg-12 col-md-12">
<div class="form-group">
<input type="text" name="email" class="form-control require" placeholder="YOUR EMAIL" data-valid="email" data-error="Email should be valid.">
</div>
</div>
<div class="col-lg-12 col-md-12">
<div class="form-group">
<input type="text" name="subject" class="form-control" placeholder="SUBJECT">
</div>
</div>
<div class="col-lg-12 col-md-12">
<div class="form-group">
<textarea name="message" class="form-control" placeholder="YOUR MESSAGE"></textarea>
</div>
</div>
<div class="response"></div>
<div class="col-lg-12 col-md-12">
<input type="hidden" name="form_type" value="contact">
<button type="submit" data-type="submit" name="submit" value="submit">Submit</button>
</div>
</form>
</div>
</div>
The Code above is a contact form for one of my practice projects im working on. Im trying to get it to link with my sendmail.php file and send it to my current email address but im not having any luck.
<?php
if( isset($_POST['submit']))
$to = "jamie#sharpsdigital.co.uk";
$sub = "Contact Form Enquiry";
$headers = "From: Star Tyres <jamie#sharpsdigital.co.uk>"."\r\n";
$headers .= "Reply-To: ".$email." \r\n";
$headers .= "X-Mailer: PHP/". phpversion()."\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = '<h4>New Contact Form Enquiry : </h4>
<p>Name: '.$first_name.'</p>
<p>Email: '.$email.'</p>
<p>Subject: '.$subject.'</p>
<p>Message: '.$message.'</p><br>
';
$mail = mail($to, $sub, $message, $headers, 'jamie#sharpsdigital.co.uk');
if ( $mail)
{
header('Location: contact.html?var=sent');
}
else
{
/* error_reporting(-1);
ini_set('display_errors', 'On');
echo 'error';
print_r(error_get_last()); */
header('Location: contact.html?var=error');
}
This one is my php, I have linked up both with using the action="sendmail.php" and using the method post. However when I got to click the button and send it just seems to go to *.com/sendmail.php and I dont get an email. What am I doing wrong?
UPDATE ==============================
After a few comments I have tried to tweak a few things. im now getting the echo command back once I hit the submit button but nothing else.
<?php
extract($_POST);
echo "Made it to sendmail.php";
if( isset($_POST['submit']))
{
$mailTo = "jamie#sharpsdigital.co.uk";
$sub = "Contact Form Enquiry";
$headers = "From: Star Tyres <jamie#sharpsdigital.co.uk>"."\r\n";
$headers .= "Reply-To: ".$email." \r\n";
$headers .= "X-Mailer: PHP/". phpversion()."\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = '<h4>New Contact Form Enquiry : </h4>
<p>Name: '.$first_name.'</p>
<p>Email: '.$email.'</p>
<p>Subject: '.$sub.'</p>
<p>Message: '.$message.'</p><br>
';
$mail = mail($to, $sub, $message, $headers, 'jamie#sharpsdigital.co.uk');
}
?>
Change your button to submit the form to this:
<input type="button" name="submit" value="Submit">
input is an element of a form, a button no. The name is what you will look for in the php ($_POST['submit'])
The value attribute is what will be displayed inside the button
HTH
<?php
extract($_POST);
if( isset($_POST['submit']))
{
$email = $_POST['email'];
$first_name = $_POST['first_name'];
$to = "jamie#sharpsdigital.co.uk";
$sub = "Contact Form Enquiry";
$headers = "From: Star Tyres <jamie#sharpsdigital.co.uk>"."\r\n";
$headers .= "Reply-To: ".$email." \r\n";
$headers .= "X-Mailer: PHP/". phpversion()."\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = '<h4>New Contact Form Enquiry : </h4>
<p>Name: '.$first_name.'</p>
<p>Email: '.$email.'</p>
<p>Subject: '.$sub.'</p>
<p>Message: '.$message.'</p><br>
';
$mail = mail($to, $sub, $message, $headers, 'jamie#sharpsdigital.co.uk');
}
?>
or, more simply:
<?php
$to = 'jamie#sharpsdigital.co.uk';
$subject = 'Contact Form Enquiry';
$message = '<h4>New Contact Form Enquiry : </h4>
<p>Name: '.$_POST['first_name'].'</p>
<p>Email: '.$_POST['email'].'</p>
<p>Subject: '.$subject .'</p>
<p>Message: '.$_POST['message'].'</p><br>
';
$headers = 'From: webmaster#example.com' . "\r\n" .
'Reply-To: ".$_POST['email']' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
TESTING PURPOSE:
create new file testemail.php and input this code:
<?php
$to = 'jamie#sharpsdigital.co.uk';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: no-reply#domain.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
then browse to page and see if you received an e-mail after...

PHP Undefined index error with form

I keep getting an error as follows when i submit my form. I'm not sure what it is. I'm running the site on WAMP (windows) and im writing it in dreamweaver CS6. Please note I'm fairly new to PHP. Thanks!
Here is the code:
Notice: Undefined index: message in S:\wamp\www\latech\contact.php on line 29
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<?php include 'includes/header.php'?>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css">
<title>Anise Technologys</title>
</head>
<body>
<div class="wrapper">
<?php include 'includes/nav.php'?>
<div class="content">
<h1 id="title-center">Contact</h1>
<?php
// Check for Header Injections
function has_header_injection($str) {
return preg_match( "/[\r\n]/", $str );
}
if (isset($_POST['contact_submit'])) {
// Assign trimmed form data to variables
// Note that the value within the $_POST array is looking for the HTML "name" attribute, i.e. name="email"
$name = trim($_POST['name']);
$email = trim($_POST['email']);
$tel = trim($_POST['tel']);
$msg = $_POST['message']; // no need to trim message
// Check to see if $name or $email have header injections
if (has_header_injection($name) || has_header_injection($email)) {
die(); // If true, kill the script
}
if (!$name || !$email || !$msg) {
echo '<h4 class="error">All fields required.</h4>Go back and try again';
exit;
}
// Add the recipient email to a variable
$to = "brad#brightsidestudios.ca";
// Create a subject
$subject = "$name sent a message via your contact form";
// Construct the message
$message .= "Name: $name\r\n";
$message .= "Email: $email\r\n\r\n";
$message .= "Message:\r\n$msg";
// If the subscribe checkbox was checked
if (isset($_POST['subscribe']) && $_POST['subscribe'] == 'Subscribe' ) {
// Add a new line to the $message
$message .= "\r\n\r\nPlease add $email to the mailing list.\r\n";
}
$message = wordwrap($message, 72); // Keep the message neat n' tidy
// Set the mail headers into a variable
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "From: " . $name . " <" . $email . ">\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: High\r\n\r\n";
// Send the email!
mail($to, $subject, $message, $headers);
?>
<!-- Show success message after email has sent -->
<h5>Thanks for contacting Anise Technologys!</h5>
<p>Please allow 24 hours for a response.</p>
<p>« Go to Home Page</p>
<?php
} else {
?>
<form method="post" action="" id="contact-form" class="pure-form pure-form-aligned">
<div class="pure-control-group">
<label for="name">Your Name</label>
<input type="text" id="name" name="name" placeholder="Name">
</div>
<div class="pure-control-group">
<label for="email">Your Emal</label>
<input type="email" id="email" name="email" placeholder="you#website.com">
</div>
<div class="pure-control-group">
<label for="tel">Your Telephone</label>
<input type="tel" id="tel" name="tel" placeholder="(xxx)xxx-xxxx">
</div>
<div class="pure-control-group">
<label for="msg">Your Message</label>
<textarea id="msg" name="msg" spellcheck="true" ></textarea>
</div>
<div class="pure-control-group">
<label for="subscribe">
<input type="checkbox" id="cb" name="subscribe" value="Subscribe">
Subscribe to Newsletter</label>
</div>
<div class="pure-control-group">
<input type="submit" class="pure-button pure-button-primary" name="contact_submit" value="Send Message">
</div>
</form>
<?php
}
?>
</div>
</div>
</body>
</html><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<?php include 'includes/header.php'?>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css">
<title>Anise Technologys</title>
</head>
<body>
<div class="wrapper">
<?php include 'includes/nav.php'?>
<div class="content">
<h1 id="title-center">Contact</h1>
<?php
// Check for Header Injections
function has_header_injection($str) {
return preg_match( "/[\r\n]/", $str );
}
if (isset($_POST['contact_submit'])) {
// Assign trimmed form data to variables
// Note that the value within the $_POST array is looking for the HTML "name" attribute, i.e. name="email"
$name = trim($_POST['name']);
$email = trim($_POST['email']);
$tel = trim($_POST['tel']);
$msg = $_POST['message']; // no need to trim message
// Check to see if $name or $email have header injections
if (has_header_injection($name) || has_header_injection($email)) {
die(); // If true, kill the script
}
if (!$name || !$email || !$msg) {
echo '<h4 class="error">All fields required.</h4>Go back and try again';
exit;
}
// Add the recipient email to a variable
$to = "brad#brightsidestudios.ca";
// Create a subject
$subject = "$name sent a message via your contact form";
// Construct the message
$message .= "Name: $name\r\n";
$message .= "Email: $email\r\n\r\n";
$message .= "Message:\r\n$msg";
// If the subscribe checkbox was checked
if (isset($_POST['subscribe']) && $_POST['subscribe'] == 'Subscribe' ) {
// Add a new line to the $message
$message .= "\r\n\r\nPlease add $email to the mailing list.\r\n";
}
$message = wordwrap($message, 72); // Keep the message neat n' tidy
// Set the mail headers into a variable
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "From: " . $name . " <" . $email . ">\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: High\r\n\r\n";
// Send the email!
mail($to, $subject, $message, $headers);
?>
<!-- Show success message after email has sent -->
<h5>Thanks for contacting Anise Technologys!</h5>
<p>Please allow 24 hours for a response.</p>
<p>« Go to Home Page</p>
<?php
} else {
?>
<form method="post" action="" id="contact-form" class="pure-form pure-form-aligned">
<div class="pure-control-group">
<label for="name">Your Name</label>
<input type="text" id="name" name="name" placeholder="Name">
</div>
<div class="pure-control-group">
<label for="email">Your Emal</label>
<input type="email" id="email" name="email" placeholder="you#website.com">
</div>
<div class="pure-control-group">
<label for="tel">Your Telephone</label>
<input type="tel" id="tel" name="tel" placeholder="(xxx)xxx-xxxx">
</div>
<div class="pure-control-group">
<label for="msg">Your Message</label>
<textarea id="msg" name="msg" spellcheck="true" ></textarea>
</div>
<div class="pure-control-group">
<label for="subscribe">
<input type="checkbox" id="cb" name="subscribe" value="Subscribe">
Subscribe to Newsletter</label>
</div>
<div class="pure-control-group">
<input type="submit" class="pure-button pure-button-primary" name="contact_submit" value="Send Message">
</div>
</form>
<?php
}
?>
</div>
</div>
</body>
</html>
Your name attribute is msg your calling it message in PHP.
<label for="msg">Your Message</label>
<textarea id="msg" name="msg" spellcheck="true" ></textarea>
$msg = $_POST['message']; // no need to trim message
Also here...
$message .= "Name: $name\r\n";
$message .= "Email: $email\r\n\r\n";
$message .= "Message:\r\n$msg";
The first occurrence should be $message = because there is nothing to concatenate when it hasn't been initialized.
You are using
<textarea id="msg" name="msg" spellcheck="true" ></textarea>
Rather use
<textarea id="msg" name="message" spellcheck="true" ></textarea>

Simple contact form failing to send

I have a simple contact form that is failing to send, I'm new to PHP so it's most likely I have forgotten something or the code is wrong. I understand that there are many questions on here around the same subject but I'm unsure about my code.
I'm getting the error message: Undefined index: send in \mail.php on line 31
HTML
<html>
<head>
<title>form</title>
</head>
<body>
<h2>Contact Form</h2>
<form id="form_id" name="form_name" action="mail.php" method="post">
<div>
<input type="text" name="name" id="name" placeholder="Name" required/>
</div>
<div>
<input type="email" name="email" id="email" placeholder="Email" required/>
</div>
<div>
<input type="number" name="tel" id="tel" placeholder="Phone" required/>
</div>
<textarea name="message" type="text" id="message" rows="5" cols="30" placeholder="Message" required></textarea>
</div>
<div>
<input type="submit" name="submit" value="submit" />
</div>
</form>
</body>
</html>
PHP
<?php
$to = 'test#gmail.com';
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$tel = $_POST['tel'];
$body = <<<EMAIL
This is a message for your website.
Name: $name
Email: $email
Tel: $tel
Message: $message
EMAIL;
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: Bob <$to>, Bob <$to>' . "\r\n";
$headers .= 'From: Website <noreply#example.com>' . "\r\n";
$headers .= 'Cc: noreplt#example.com' . "\r\n";
$headers .= 'Bcc: noreply#example.com' . "\r\n";
if ($_POST['send']){
mail($to, $subject, $body, $header);
echo 'Message Sent.';
} else {
die('Failed to Send');
}
?>
use mail($to, $subject, $body, $headers);
here you used $header

PHP not grabbing form information

I'm relatively new to PHP and I'm having trouble getting my PHP to take my form data and submit it in an email. The email sends to me with the plain text I have in it but all the form data isn't there. Does anybody have any ideas of what's wrong?
Here's the HTML:
<div id="box3" class="clearfix">
<form action="contact.php" method="post" enctype="text/plain">
<div id="greyContainer" class="clearfix">
<p id="text5">
Contact Us
</p>
<p id="text6">
Feel free to contact us and leave a message if you have any general questions!
</p>
<label id="formgroup">
<p id="text7">
Name:
</p>
<input id="name" type="text" value="Full Name" name="name"></input>
</label>
<label id="formgroup1">
<p id="text8">
Number:
</p>
<input id="phone_number" type="text" value="Phone Number" name="phone_number"></input>
</label>
<label id="formgroup2">
<p id="text9">
Email:
</p>
<input id="email" type="text" value="Email Address" name="email"></input>
</label>
<label id="formgroup3">
<p id="text10">
Message:
</p>
<textarea id="message_block" name="message_block" >Message or question...</textarea>
</label>
<p id="text11">
<span id="textspan">AVA Roofing & Siding<br />12 Arcade Ave.<br />Amherst, NY 14226<br />716.602.3947</span><br />
</p>
<img id="image1" src="img/envelope.png" class="image" />
<a href="thank_you.html">
<input id="input" type="submit" value="Submit" name="submit" ></input>
</a>
<div id="whiteLine" class="clearfix">
</div>
</form>
</div>
</div>
Here's the PHP:
<?php
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$to = "example#gmail.com" ;
$from = $_POST['email'] ;
$name = $_POST['name'] ;
$headers = "From: $from";
$subject = "AVA Roofing Contact Form";
$message2 = $_POST['message_block'];
$number = $_POST['phone_number'];
$message = "A visitor has submitted the following requirements. \n\nName: $name\n\nEmail: $email\n\nNumber: $number\n\nMessage: $message";
$headers = "From:" . $from;
$headers2 = "From:" . $to;
mail($to, $subject, $message, $headers);
$send = mail($to, $subject, $message, $headers);
if($send)
{header( "Location: http://www.example.com/folder/thank_you.html" );}
else
{print "We encountered an error sending your mail, please notify webmaster#YourCompany.com"; }
?>
You've got the wrong encoding on your form:
<form action="contact.php" method="post" enctype="text/plain">
^^^^^^^^^^^^^^^^^^^^^
Since you're telling the browser to send it as text/plain, it will not be processed by PHP. For this simple form, you don't need to specify ANY encoding. Just accept the defaults.
If you insist on specifying an encoding, it should be application/x-www-form-urlencoded for standard forms, or multipart/form-data if you're doing file uploads.
You can send to other file like file.php and in this file the action you would have something like this:
$recipiente = "your#email.com ";
$asunto = "Formulario";
$message ="name: ".$name."<br>";
$message .="email: ".$email."<br>";
$message .="coment: ".$coment."<br>";
$message = stripslashes($message);
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type:text/html; charset=iso-8859-1\r\n";
$headers .= "From: $email\r\n";
$headers .= "Reply-to: $email\r\n";
$headers .= "Cc: $email\r\n";
mail($recipiente,$asunto,$message,$headers);

Mail is not coming properly using php?

I am using below simple code to send mail using php. when i echo the line $headers = "From: . $email\r\n"; //echo $headers; exit; which results like From: . test#email.com.
I found dot is printing before mail address , so mail is coming but not properly.If i remove dot , mail is not even coming.Whats wrong with this code ?
<?php
if (isset($_REQUEST['user_email']))
//if "email" is filled out, send email
{
//send email
$email = $_REQUEST['user_email'];
$user_name = $_REQUEST['user_name'];
$user_message = $_REQUEST['user_message'];
include 'contact_mail_form.php';
$to = "testtest#gmail.com";
$message = $contactText;
$subject = "Test Mail";
$headers = "From: . $email\r\n"; //echo $headers; exit;
$headers .= "Content-type: text/html\r\n";
mail($to,$subject,$message,$headers);
echo "Thank you for using our mail form";
}
else
//if "email" is not filled out, display the form
{
?>
<form id="contact_form" name="ContactForm" action="" method="post" onsubmit="return checkContact(this);">
<div class="wrapper">
<div class="fright">
<div class="name">Message:</div>
<textarea cols="1" rows="1" name="user_message" id="user_message" ></textarea>
<span class="clear"></span> </div>
<div class="fleft">
<div>
<div class="name">Your Name:</div>
<input type="text" class="input" name="user_name" id="user_name" />
<span class="clear"></span> </div>
<div>
<div class="name">E-mail:</div>
<input type="text" class="input" name="user_email" id="user_email" />
<span class="clear"></span> </div>
</div>
</div>
<div class="buttons"><a class="more" href="javaScript:void(0);" onClick="document.getElementById('contact_form').reset()">clear</a> <input class="more1" type="SUBMIT" class="button2" value="Send" name="" /> </div>
</form>
<?php } ?>
Try it like this your dot is acting as string not as concatenation
$headers = "From:" . $email."\r\n";
Maybe because \r\n should be surrounded with " not '
And Also
$headers .= 'Content-type: text/html'. "\r\n";

Categories