Search the Community
Showing results for tags 'blank emails'.
-
<?php header('Content-type: application/json'); $status = array( 'type'=>'success', 'message'=>'Email sent!' ); $name = @trim(stripslashes($_POST['name'])); $email = @trim(stripslashes($_POST['email'])); $subject = @trim(stripslashes($_POST['subject'])); $message = @trim(stripslashes($_POST['message'])); $email_from = $email; $email_to = 'free.bks@gmail.com'; $body = 'Name: ' . $name . "\n\n" . 'Email: ' . $email . "\n\n" . 'Subject: ' . $subject . "\n\n" . 'Message: ' . $message; $success = @mail($email_to, $subject, $body,'From: <'.$email_from.'>'); echo json_encode($status); die; This above is the php email script I have . Form code I am using is below <div class="status alert alert-success" style="display: none"></div> <form id="contact-form" method="POST" class="row mt10 style1 contact-form" action="sendemail.php" name="contact-form"> <div class="col-md-6"> <input type="text" name="name" value="Enter your full name" required="required" onfocus="if(this.value=='Enter your full name')this.value=''" onblur="if(this.value=='')this.value='Enter your full name';" placeholder="name"/> </div> <div class="col-md-6"> <input type="text" name="email" placeholder="email" value="Enter your full e-mail" required="required" onfocus="if(this.value=='Enter your full e-mail')this.value=''" onblur="if(this.value=='')this.value='Enter your full e-mail';" /> </div> <div class="col-md-12"> <textarea rows="7" cols="5" name="message" placeholder="message" id="message" required="required" onfocus="if($(this).val()=='Write your message...'){$(this).val('');}" onblur="if(this.value=='')this.value='Write your message...';" >Write your message...</textarea> <div class="submit_btn"> <div class="inner"> <input class="submit btn" type="submit" value="Submit" name="" /> </div> </div> </div> </form> I am getting emails , been trying for the last few hours changing things , but its not working ; may be I am overlooking something important . I am learning php .