$mailid = $Obj64["id"]; debugl("Mailid : {$mailid}"); debugl("base64string : {$base64string}"); $host = unserialize(base64_decode($base64string)); if (is_null($host->emailResponsavel)) { echo "<h1>Não encontramos o registro do e-mail do responsável! mailid={$mailid} :("; exit; } else { $mail->Subject = "Subject Empresa({$host->nomeEmpresa}) host({$host->nome}) mail({$mailid})"; $mail->AddAddress($host->emailResponsavel); $ArrayCopiasControladas = $host->CopiasControladas; if (!is_null($ArrayCopiasControladas)) { foreach ($ArrayCopiasControladas as $Copia) { $mail->AddCC($Copia["email"], $Copia["nome"]); debugl("Cc nome:" . $Copia["nome"] . " e-mail:" . $Copia["email"]); } } $mail->Body = processaRelatorioHost($mailid, $host); if (!$mail->Send()) { echo "Message was not sent"; echo "Mailer error: " . $mail->ErrorInfo; } else { echo "Message has been sent (mailid={$mailid})<br>"; if (setDataEnvio($mailid)) { echo "Marcado como enviado(mailid={$mailid})<br>"; } else { echo "Não Marcado como enviado(mailid={$mailid}) #erro"; } } } }
<?php header('Content-type: text/html; charset=ISO-8859-1'); // Allow access from anywhere. Can be domains or * (any) header('Access-Control-Allow-Origin: *'); // Allow these methods of data retrieval header('Access-Control-Allow-Methods: POST, GET, OPTIONS'); // Allow these header types header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept'); include "fhost.php"; $codhost = $_GET["codhost"]; $tracking = $_GET["tracking"]; $preview = $_GET["preview"]; if (is_null($codhost)) { debugl("<h1>Informe um codigo de hostname</h1>"); exit; } else { /** * Cria o objeto de host com todos os valores possiveis. **/ $identificador = generateID(); $host = createHost($codhost); debugl("Grafico ID -> {$identificador}"); debugl("Inseridos -> " . registraGeracaoHTML($identificador, $host)); if (strcmp($preview, "true") == 0) { echo processaRelatorioHost($identificador, $host); } echo "<h2>Id Gerado: {$identificador}<h2>"; }
<?php header('Content-type: text/html; charset=ISO-8859-1'); // Allow access from anywhere. Can be domains or * (any) header('Access-Control-Allow-Origin: *'); // Allow these methods of data retrieval header('Access-Control-Allow-Methods: POST, GET, OPTIONS'); // Allow these header types header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept'); include "fhost.php"; $mailid = isset($_GET["mailid"]) ? $_GET["mailid"] : null; $tracking = isset($_GET["tracking"]) ? $_GET["tracking"] : null; $object = isset($_GET["object"]) ? $_GET["object"] : null; $host = new stdClass(); if (!is_null($object)) { $host = unserialize(base64_decode($object)); echo processaRelatorioHost($mailid, $host); } else { if (is_null($mailid)) { echo "<h1>Informe um codigo de email enviado</h1>"; exit; } else { $resultado = RecuperaHistoricoGrafico($mailid); $host = unserialize(base64_decode($resultado)); if (is_null($host->nome)) { echo "<h1>Não encontramos o registro do e-mail ({$mailid}) para o host ({$codhost}) </br>:("; exit; } echo processaRelatorioHost($mailid, $host); } }