php - PHPMailer: Sending Failed -


im trying make contact form, searched alot on web didn't found solution works.

this contact-form html , php:

<?php if(isset($_post['submit'])) {    $message=       'name:    '.$_post['name'].'<br />   subject:  '.$_post['message'].'<br />   email:    '.$_post['email'].'   ';    require 'class.phpmailer.php';   require 'phpmailerautoload.php';    // instantiate class   $mail = new phpmailer();   // set smtp   $mail->issmtp();                // sets smtp connection   $mail->smtpauth = true;         // connection smtp require     authorization   $mail->smtpsecure = "tls";      // connect using tls connection   $mail->host = "smtp.gmail.com";  //gmail smtp server address   $mail->port = 587;  //gmail smtp port    // authentication   $mail->username   = '**********@gmail.com'; // full gmail address   $mail->password   = '**********'; // gmail password    $mail->smtpdebug = 1;   // compose   $mail->setfrom($_post['email'], $_post['name']);   $mail->addreplyto($_post['email'], $_post['name']);   $mail->subject = "new contact form enquiry";      // subject (which isn't required)   $mail->msghtml($message);    // send   $mail->addaddress("*********@gmail.com", "recipient name"); // send - recipient   $result = $mail->send();      // send!   $message = $result ? 'successfully sent!' : 'sending failed!';   unset($mail); } ?> <html> <head> <title>contact form</title> </head> <body>    <div style="margin: 100px auto 0;width: 300px;">     <h3>contact form</h3>     <form name="form1" id="form1" action="" method="post">       <fieldset>         <input type="text" name="name" placeholder="full name" />         <br />         <input type="text" name="message" placeholder="message" />         <br />         <input type="text" name="email" placeholder="email" />         <br />         <input type="submit" name="submit" value="send" />       </fieldset>     </form>     <p><?php if(!empty($message)) echo $message; ?></p>   </div>  </body> </html> 

i error. have latest version of phpmailer, username , password correct.

can please help?


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -