PHP email script not sending emails -


this question has answer here:

this php email script want use website. creating website father's company, , decided make bootstrap. html , css knowledge required still do, beyond knowledge. somewhere on internet dug script , doesn't work me. sure there logical reason this, have no knowledge whatsoever of php-scripting... hoping newbie out. willing learn, study php simple script(i not planning more web "development") seems bit overexaggerating. anyway, rambling on much. here script found(i've called it: sendemail.php):

<?php 'success', 'message'=>'thank contacting us. possible shall in touch ' );      $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 = 'email_adress_here';   $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;  ?> 

of course, replaced value "email_to" email adress of choice, tested multiple email adresses , doesn't work. spinning icon "processing" text defined in main.js file, that's it. stays @ forever. feel necessary understand why php-script isn't working(perhaps i'm wrong), here relevant html code in bootstrap form:

    <section id="contact-page">     <div class="container">         <div class="center">             <h2>be in touch us:</h2>             <p class="lead">dummy text</p>         </div>         <div class="row contact-wrap">             <div class="status alert alert-success" style="display: none"></div>             <form id="main-contact-form" class="contact-form" name="contact-form" method="post" action="sendemail.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>e-mail *</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>subject *</label>                         <input type="text" name="subject" class="form-control" required="required">                     </div>                     <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>         </div> </section> 

if require more information or anything, please tell , provide immediately, because dying work.

two things want highlight:

  1. the form made preset bootstrap tags, , of bootstrap. maybe affects way script works?
  2. i working on locally on pc, isn't run server or anything. still need take out test spin. don't know if affects way email forwarded... yeah, complete noob.

all , tips appreciated , thank in advance!

probably server manager not configured send mails. if you using wamp, xamp, apache on linux, need configure mail server it.


Comments

Popular posts from this blog

tcpdump - How to check if server received packet (acknowledged) -