Sending email using PHPMailer PHP Syntax error? -


hey guys trying use php mailer send email through contact form on website.

i used these settings.

if (empty($errors)) {      $m = new phpmailer;     $m->issmtp();     $m->smtpauth = true;      $m->host = 'smtp.gmail.com';     $m->username = 'myemail@gmail.com';     $m->password = 'its correct password';     $m->smtpsecure = 'ssl';     $m->port = 465;     $m->ishtml();     $m->subject = 'submission of contact form';     $m->body = 'from:' . $fields['name'] . ' (' . $fields['email'] . ')<p>' .         $fields['message'] . '</p>';     $m->fromname = 'contact';     $m->addaddress('myemail@gmail.com', 'myname');     if ($m->send()) {         header('location: thanks.php');         die();     } else {         $errors[] = 'sorry, try again later.';     } } 

i new php, seems have syntax error somewhere prevents email being sent. when inspect page 302 found , 200 ok working fine.

what missing in code?


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -