i'm having little problem contact form. i'm using bootstrap , phpmailer. problem email body doesn't include variables contact form.
the massage i'm getting on email "wiadomość od: firma: e-mail: telefon: treść wiadomości:
the code down below:
<?php require '../../phpmailer-master/phpmailerautoload.php'; // require '../../phpmailer-master/class.smtp.php'; $mail = new phpmailer(true); $mail->charset = 'utf-8'; $mail->smtpdebug = false; $mail->issmtp(); $mail->host = 'xxx.com.pl'; $mail->smtpauth = true; $mail->username = 'xxx@.com.pl'; $mail->password = 'xxx'; $mail->port = 587; $mail->setfrom('xxx@.com.pl', 'centru'); $mail->addaddress('xxx@gmail.com', 'odbiorca'); $mail->subject = "wiadomość ze strony internetowej"; $mail->ishtml(true); // $name = $_post['inputname']; // $company = $_post['inputfirma']; // $email = $_post['inputemail']; // $phone = $_post['inputphone']; // $message = $_post['inputsubject']; $mail->body = "wiadomość od: " .$_post['inputname']."\nfirma: " .$_post['inputfirma']. "\ne-mail: " .$_post['inputemail']. "\ntelefon: " .$phone = $_post['inputphone']. "\ntreść wiadomości: " .$_post['inputsubject']; if(!$mail->send()) { echo 'wiadomość nie mogła zostać wysłana'; echo 'mailer error: ' . $mail->errorinfo; } else { echo 'wiadomość została wysłana'; }
and html
<form class="padding-top-40" role="form" id="contactform" class="contact-form" data-toggle="validator" class="shake"> <div class="form-group"> <label for="inputname">imię nazwisko</label> <input type="text" class="form-control" id="inputname" name="fullname" placeholder="imię nazwisko" required data-error="proszę wpisać swoje imię nazwisko"> <div class="help-block with-errors"></div> </div> <div class="form-group"> <label for="inputfirma">firma</label> <input type="text" class="form-control" id="inputfirma" name="subject" name="comments" placeholder="firma" required data-error="proszę wpisać nazwę firmy"> <div class="help-block with-errors"></div> </div> <div class="form-group"> <label for="inputemail">e-mail</label> <input type="email" class="form-control" id="inputemail" name="emailid" placeholder="e-mail" required data-error="proszę wpisać swój email"> <div class="help-block with-errors"></div> </div> <div class="form-group"> <label for="inputphone">telefon kontaktowy</label> <input type="number" class="form-control" name="phone" id="inputphone" placeholder="numer telefonu" required data-error="proszę wprowadzić numer telefonu"> <div class="help-block with-errors"></div> </div> <div class="form-group"> <label for="inputsubject">temat</label> <textarea type="text" class="form-control" name="subject" id="inputsubject" placeholder="treść wiadomości" rows="4" required data-error="proszę wpisać treść wiadomości"></textarea> <div class="help-block with-errors"></div> </div> <div class="padding-top-20"> <button type="submit" value="send" class="btn btn-default" id="submit" >wyślij</button> <div id="msgsubmit" class="h3 text-center"></div> </div> </form>
thanks in advance!
use name instead of id , check
$name=$this->input->post('fullname'); $name=$_post['fullname'];
Comments
Post a Comment