<?php

ini_set('memory_limit', '128M');
include 'funcoes.php';
$chm = new ChamadoDAO();
$box = new ReceiveImapDAO('suporte+cartoriopostal.com.br', 'a123d321', '*****@*****.**', 'mail.cartoriopostal.com.br', 'imap', '143/novalidate-cert', false);
$box->connect();
$total = $box->total();
$cont = 0;
#$total = 10;
for ($i = 1; $i <= $total; $i++) {
    #exit;
    #******************************
    $box->headers($i);
    $size = (double) (double) mb_strwidth($box->body) / 1024;
    if ($size <= 15000) {
        #verifica se o email que enviou foi cartorio, softfox, senĂ£o exclui
        if (substr_count($box->send_from, 'cartoriopostal') > 0 || substr_count($box->send_from, 'softfox') > 0) {
            $subject = $box->subject;
            $subject = str_replace('Res:', '', $subject);
            $subject = str_replace('RES:', '', $subject);
            $subject = str_replace('Enc:', '', $subject);
            $subject = str_replace('Enc.', '', $subject);
            $subject = str_replace('enc:', '', $subject);
            $subject = str_replace('enc.', '', $subject);
            $subject = str_replace('ENC.', '', $subject);
            $subject = str_replace('ENC:', '', $subject);
            $subject = str_replace('Re:', '', $subject);
            $subject = str_replace('|aberto', '| aberto', $subject);
            $subject = str_replace('/aberto', '| aberto', $subject);
            $subject = str_replace('/ aberto', '| aberto', $subject);
Example #2
0
<?php

ob_start();
require "../includes/funcoes.php";
require "../includes/global.inc.php";
require_once '../model/Database.php';
$box = new ReceiveImapDAO('suporte+cartoriopostal.com.br', 'a123d321', '*****@*****.**', 'mail.cartoriopostal.com.br', 'imap', '143/novalidate-cert', false);
$box->connect();
$total = $box->total();
for ($i = 1; $i <= $total; $i++) {
    $box->headers($i);
    echo $box->mail_header();
    echo $box->mail_body_strip_tags();
    #echo $box->body;
}
$box->disconnect();