<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';
$mail = new PHPMailer(true);
    
    try{   
$mail->isSMTP();
$mail->SMTPDebug = 0;
$mail->Host = 'mail.bcacentro.com.mx';
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = 'noresponder@bcacentro.com.mx';
$mail->Password = 'jYz0jBQnjUlO';
$mail->SMTPSecure = 'ssl';
$mail->setFrom('noresponder@bcacentro.com.mx', 'No Responder TICs BCA');
$mail->addAddress('infraestructura.tics@bcacentro.com','Sergio Hernández');
$mail->addAddress('virtualbx11@gmail.com','Sergio Hernández VB');
$mail->addBCC('soportetecnicobca@gmail.com','TICs BCA');
$mail->isHTML(true);
$mail->CharSet = 'UTF-8';
$mail->Subject = 'ALERTAS BCA / SERVICIOS';
$mail->Body = '<html>
    <head>
    <style>
    
    table {
     font-family: Arial, sans-serif;
     padding: 10px;
      }
      p{
           padding-top: 10px;
           padding-right: 0px;
      }
    .tdcabecera {
     font-family: Arial, sans-serif;
     padding: 10px;
     background-color: #114C73;
     color: white;
      }
     .tdinfo{
        font-family: Arial, sans-serif;
        padding: 1px;
        text-align: center;
        width: 20%;

    }
      .tdinfoc{
        font-family: Arial, sans-serif;
        padding: 1px;
        text-align: center;
        width: 20%;
        background-color: #dddddd;

    }
      
     .tdpie{
        padding: 10px;
        text-align: center;
        width: 20%;
        background-color: #114C73;
        color: white;
    }

    </style>
    </head>
    <body>
        <table style="width:500px">
    <tr>
        <td style="width:20%"><img src="https://web.mibca.mx/bca/images/978t.png" alt="Cementin"  align="left" />
    </td>
    <td style="width:80% ; align: left;"><p><strong><h2 style="color:  #C60000;">ALERTAS</h2></strong></p>
    </td>
    </tr>
    <tr>
    <td colspan="4" class="tdcabecera"><strong>Estimado Usuario </strong> <br> <br>Ha sido registrado una alerta en los servicios registrados para monitoreo, <a href="https://web.mibca.mx/bca/vistas/servicios.php" target="_blank" style="color:white;"> <strong>STATUS PAGE</strong></a>
    </td>
    </tr>
    <tr>
    <td colspan="1"> <br><strong style="color: #114C73;">Servicio:</strong></td>
    <td colspan="3"> <br><strong style="color: #114C73;">'.$nombres.'</strong></td>
    </tr>

    <tr>
         <td class="tdinfoc"> <strong> Cambio detectado  <strong></td>
         <td class="tdinfoc" style="width: 50%;">Fecha</td>
         
      
    </tr>
    
     <tr>
        <td class="tdinfo" ><p style="color: '.$color.';">'.$estatus.'</p> </td>
        <td  class="tdinfo" >'.$f_ac.'</td>
    </tr>
      <tr>
  
      <tr>
    <td colspan="4" class="tdpie"> <small>SERVICIOS TICs BCA.</small></td>
    </tr>
   
    
    </table>

    </body>
    </html>';
if ($mail->send()) {

}
}catch (Exception $e) {
    
    }

?>