<?php

ini_set('display_errors',1);
ini_set('display_startup_erros',1);

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

// Enviar Email
if(isset($_POST['enviar']) && $_POST['enviar'] == 'email') {

  require 'js/PHPMailer/src/Exception.php';
  require 'js/PHPMailer/src/PHPMailer.php';
  require 'js/PHPMailer/src/SMTP.php';

  $mail = new PHPMailer;
  $mail->SMTPDebug = 0;
  // Autenticando o usuário do email
  $mail->Host = 'wm.pokerweb.com.br';
  $mail->isSMTP();
  $mail->SMTPAuth = true;
  $mail->SMTPSecure = "TLS";
  $mail->Port = 587;
  $mail->Username = 'pokerweb@pokerweb.com.br';
  $mail->Password = '6Tb238BXqgzr';

  //587

  $mail->setFrom('pokerweb@pokerweb.com.br', 'PokerWeb'); // Enviado de
  $mail->addReplyTo('pokerweb@pokerweb.com.br', 'PokerWeb'); // Resposta para
  $mail->addAddress('leandro.23.fozz@gmail.com', 'Jeferson');

  //$mail->IsHTML(true);
  //$mail->CharSet = 'UTF-8';
  $mail->Subject = 'assunto';
  $mail->Body = 'mensagem';

  if(!$mail->send()){echo 'Mailer Error: '.$mail->ErrorInfo;}else{
    echo 'Email enviado com sucesso !!!';
  }
}

?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
  <meta charset="UTF-8">
  <title>PokerWeb</title>
  <link rel="icon" type="image/png" href="images/logos/favicon.png" />
  <meta name="robots" content="nofollow">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

  <link rel="stylesheet" href="css/bootstrap.css">

  <link rel="stylesheet" href="css/fontawesome5/css/all.css">
  <link rel="stylesheet" href="css/fontawesome5/css/v4-shims.css">

  <link rel="stylesheet" href="js/select2/select2.css">
  <link rel="stylesheet" href="css/plugin.css?v=2">
  <link rel="stylesheet" href="css/font.css">
  <link rel="stylesheet" href="css/style.css">
  <link rel="stylesheet" href="css/simpleAutoComplete.css" />
  <link rel="stylesheet" href="css/personalizado.css">

  <script src="js/jquery.min.js"></script>
  <script src="js/bootstrap.min.js"></script>
  <script src="js/pace.min.js"></script>

  <script type="text/javascript" language="javascript" class="init">

  </script>
</head>
<body>

<section id="content">

<div class="clearfix padder bg-fncr-clearfix">
<h3 class="m-b">Clubes</h3>

</div>

<section id="content" class="content-sidebar bg-white" style="padding-bottom: 100px">
<!-- .main -->
<section class="main">
<br>

  <form class="m-b-none" method="post" action="" enctype="multipart/form-data">
    <input type="hidden" name="enviar" value="email" />
    <input type="hidden" class="id_registro" name="id_registro" value="" />
    <input type="hidden" class="tipo" name="tipo" value="" />
    <div class="modal-dialog modal-sm" style="width: 350px;">
      <div class="modal-content">
        <div class="modal-header bg-info">
          <button type="button" class="close" data-dismiss="modal"><i class="fa fa-times"></i></button>
          <h4 class="modal-title" id="myModalLabel">Enviar E-mail</h4>
        </div>
        <div class="modal-body">
          <div class="row">
            <div class="col-lg-12 text-center">
              Enviar o E-mail?
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Cancelar</button>
          <button type="submit" class="btn btn-sm btn-inverse" data-loading-text="Enviando...">Enviar</button>
        </div>
      </div>
    </div>
  </form>

  <pre>
  $mail = new PHPMailer;
  $mail->SMTPDebug = 0;
  // Autenticando o usuário do email
  $mail->Host = 'wm.pokerweb.com.br';
  $mail->SMTPAuth = true;
  $mail->Username = 'pokerweb@pokerweb.com.br';
  $mail->Password = '6Tb238BXqgzr';

  $mail->setFrom('pokerweb@pokerweb.com.br', 'PokerWeb'); // Enviado de
  $mail->addReplyTo('pokerweb@pokerweb.com.br', 'PokerWeb'); // Resposta para
  $mail->addAddress('jeferson@pokerweb.com.br', 'Jeferson');

  $mail->IsHTML(true);
  $mail->CharSet = 'UTF-8';
  $mail->Subject = 'assunto';
  $mail->Body = 'mensagem';

  if(!$mail->send()){echo 'Mailer Error: '.$mail->ErrorInfo;}else{
    echo 'Email enviado com sucesso !!!';
  }
  </pre>

</section>
</section>

<!-- app -->
<script src="js/app.js"></script>
<script src="js/app.plugin.js"></script>
<script src="js/app.data.js"></script>

</body>
</html>