From 9d4e77f13872bfc9686adf0faa545322ab200e1e Mon Sep 17 00:00:00 2001 From: "alejandro.lara" Date: Wed, 3 Jul 2024 11:28:40 -0600 Subject: [PATCH] Mensajes de error de correos --- action/solicitud_insert.php | 6 +++++- class/mailer.php | 1 + class/manda_correo.php | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/action/solicitud_insert.php b/action/solicitud_insert.php index a2bd3cd..71d4dad 100644 --- a/action/solicitud_insert.php +++ b/action/solicitud_insert.php @@ -194,7 +194,11 @@ try{ exit(); } -MandaCorreos::enviarCorreo($db, $asunto, $texto, $user->facultad["facultad_id"], MandaCorreos::COORDINADOR); +if(!MandaCorreos::enviarCorreo($db, $asunto, $texto, $user->facultad["facultad_id"], MandaCorreos::COORDINADOR)){ + echo "ERROR Correo
"; + //header("Location: ".$pag."?error=2"); + exit(); +} header("Location: ".$pag."?ok=0"); diff --git a/class/mailer.php b/class/mailer.php index c12d802..35ab593 100644 --- a/class/mailer.php +++ b/class/mailer.php @@ -82,6 +82,7 @@ class Mailer{ if ($mail->Send()) { return true; }else{ + echo $mail->ErrorInfo; echo "Error al enviar correo"; return false; } diff --git a/class/manda_correo.php b/class/manda_correo.php index af18a62..2cd006c 100644 --- a/class/manda_correo.php +++ b/class/manda_correo.php @@ -77,9 +77,10 @@ class MandaCorreos{ if($_ENV['DB_NAME'] == "paad_pruebas" || self::PRUEBAS){ $asunto = "PRUEBAS-".$asunto; } - Mailer::enviarCorreo($to, $asunto, $texto, true); + return Mailer::enviarCorreo($to, $asunto, $texto, true); } + return true; } } ?> \ No newline at end of file