public function EnviarCorreo(CorreosDTO $dto)
 {
     $mailer = new AttachMailer("*****@*****.**", $dto->getDestinatario(), $dto->getAsunto(), $dto->getContenido());
     if ($dto->getArchivos() == '') {
         $dto->setArchivos('../img/logo.png');
     }
     $mailer->attachFile($dto->getArchivos());
     $resultado = $mailer->send() ? "True" : "True";
     return $resultado;
 }
Пример #2
0
<?php

$mailer = new AttachMailer("*****@*****.**", "*****@*****.**", "mail sender class", "hello <b>content</b>");
$mailer->attachFile("a.pdf");
$mailer->attachFile("a.pdf");
$mailer->send() ? "envoye" : "probleme envoi";
Пример #3
0
<?php

require_once 'AttachMailer.php';
$mailer = new AttachMailer("*****@*****.**", "*****@*****.**", "asunto", "hello contenido del mensaje");
$mailer->attachFile("ok.pdf");
$mailer->send() ? "Enviado" : "Problema al enviar";
Пример #4
0
         $respuesta = '
                 <img src="images/ok.png" width="100">
                 <h4>
                     Oficio enviado correctamente.
                 </h4>
                 ';
     } else {
         $respuesta = '
                 <img src="images/error.png" width="100">
                 <h4>
                     Ha ocurrido un error.
                 </h4>
                 ';
     }
 } else {
     $mailer = new AttachMailer("*****@*****.**", "{$mailDestinatario}", "{$asuntoMail}", "{$cuerpoMail}");
     $oficio = "Oficios/Oficio_" . $datosOficio['noOficio'] . ".pdf";
     $mailer->attachFile($oficio);
     if (file_exists($oficio)) {
         $res = $mailer->send() ? "OK" : "error";
     }
     if ($res == "OK") {
         $respuesta = '
                 <img src="images/ok.png" width="100">
                 <h4>
                     Oficio enviado correctamente.
                 </h4>
                 ';
     } else {
         $respuesta = '
                 <img src="images/error.png" width="100">
Пример #5
0
         $correo .= ' ' . $mail1;
     }
     if ($mail2) {
         $mailer = new AttachMailer("*****@*****.**", "{$mail2}", "Oficio_" . $noOficio, "Cuerpo del Email");
         $mailer->attachFile($Oficio);
         $res1 = $mailer->send() ? "OK" : "{$mail2}";
         $correo .= ' ' . $mail2;
     }
     if ($mail3) {
         $mailer = new AttachMailer("*****@*****.**", "{$mail3}", "Oficio_" . $noOficio, "Cuerpo del Email");
         $mailer->attachFile($Oficio);
         $res1 = $mailer->send() ? "OK" : "{$mail3}";
         $correo .= ' ' . $mail3;
     }
     if ($mail4) {
         $mailer = new AttachMailer("*****@*****.**", "{$mail4}", "Oficio_" . $noOficio, "Cuerpo del Email");
         $mailer->attachFile($Oficio);
         $res1 = $mailer->send() ? "OK" : "{$mail4}";
         $correo .= ' ' . $mail4;
     }
 }
 if ($res == "OK" || $res1 == "OK" || $res2 == "OK" || $res3 == "OK" || $res4 == "OK") {
     $respuesta = '
              <img src="images/ok.png" width="100">
              <h4>
                 Oficio enviado correctamente a: ' . $correo . '
              </h4>';
 } else {
     if ($res != 'OK') {
         $mensaje .= $res;
     }
Пример #6
0
                         ';
         }
     } else {
         $respuesta = '
                     <img src="images/error.png" width="100">
                     <h4>
                       Ha ocurrido un error
                     </h4>
                     ';
     }
 } else {
     $_FILES["imagen"]["name"];
     $archivoAdjunto = guardaArchivo("Respuestas", $nom);
     if ($query2->insert("respuesta", "fecha, asunto, redaccion, archivoAdjunto, oficio_idOficio", "now(), '{$v_asunto}', '{$v_redaccion}','{$archivoAdjunto}', {$vR_id}")) {
         require_once 'sources/AttachMailer.php';
         $mailer = new AttachMailer("*****@*****.**", "{$mail}", "{$v_asunto}", "{$cuerpoMail}");
         $mailer->attachFile($archivoAdjunto);
         $res = $mailer->send() ? "OK" : "error";
         if ($res == "OK") {
             $query->update("oficio", "status=3", "idOficio={$vR_id}");
             $respuesta = '
                         <img src="images/ok.png" width="100">
                         <h4>
                           Respuesta enviada correctamente
                         </h4>
                         ';
         } else {
             $respuesta = '
                         <img src="images/error.png" width="100">
                         <h4>
                           Ha ocurrido un error