jai uriyal Posted June 18, 2015 Share Posted June 18, 2015 Hi I am trying to making a contact form with php and html but it is not working plz help me...... My php and html code are following..... HTML Code..... <form id="main-contact-form" class="contact-form" name="contact-form" method="post" action="send_email.php"> <div class="col-sm-5 col-sm-offset-1"> <div class="form-group"> <label>Name *</label> <input type="text" name="name" class="form-control" required="required"> </div> <div class="form-group"> <label>Email *</label> <input type="email" name="email" class="form-control" required="required"> </div> <div class="form-group"> <label>Phone</label> <input type="number" class="form-control"> </div> <div class="form-group"> <label>Company Name</label> <input type="text" class="form-control"> </div> </div> <div class="col-sm-5"> <div class="form-group"> <label>Message *</label> <textarea name="message" id="message" required="required" class="form-control" rows="8"></textarea> </div> <div class="form-group"> <button type="submit" name="submit" class="btn btn-primary btn-lg" required="required">Submit Message</button> </div> </div> </form> PHP Code..... <?php header('Content-type: application/json'); $status = array( 'type'=>'success', 'message'=>'Thank you for contact us. As early as possible we will contact you ' ); $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 = 'jai.5025@gmail.com';//replace with your email $body = 'Name: ' . $name . "nn" . 'Email: ' . $email . "nn" . 'Subject: ' . $subject . "nn" . 'Message: ' . $message; $success = @mail($email_to, $subject, $body, 'From: <'.$email_from.'>'); echo json_encode($status); die; Note- I am using bootstrap based template. thanks in advance Link to comment Share on other sites More sharing options...
justsomeguy Posted June 18, 2015 Share Posted June 18, 2015 What do you mean it's not working, what exactly happens? Link to comment Share on other sites More sharing options...
jai uriyal Posted June 19, 2015 Author Share Posted June 19, 2015 I want all the information in my email id which I put on php file but I am not getting any info in my email id even data (information of input box) is not submitting. 1 Link to comment Share on other sites More sharing options...
Alatoru Posted June 19, 2015 Share Posted June 19, 2015 Try readin this here, maybe you are missing the way mail function is being used:http://stackoverflow.com/questions/14456673/sending-email-with-php-from-an-smtp-server Link to comment Share on other sites More sharing options...
selath Posted July 3, 2015 Share Posted July 3, 2015 I want all the information in my email id which I put on php file but I am not getting any info in my email id even data (information of input box) is not submitting. Im having the same problem , and after some really deep search i found out that the send email function doesn't work automatically with local web Servers such as (xampp, wampp. ampps .... and all other kind of "amppss out there!"). If you are using those kind of local servers, the mail() function won't work. You actually have to reformat some files in the server that you are using and only than it will work .... Note: As i said ..... im having the same problam with this ... and i have not tryed this things out ! however , that is what people are saying so... Link to comment Share on other sites More sharing options...
coolshrimp Posted July 28, 2015 Share Posted July 28, 2015 see my reply here for how to send mail with xampp: http://w3schools.invisionzone.com/index.php?showtopic=53554 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now