Exemplo n.º 1
0
    $arr = array('AddAddress' => $AddAddress, 'AddCC' => $AddCC, 'AddReplyTo' => $AddReplyTo, 'AddAttachment' => $AddAttachment, 'AddEmbeddedImage' => $AddEmbeddedImage, 'Subject' => 'Subject Thử gửi mail support UTF-8', 'Body' => '<h1>Test mail of PHPMailer html</h1>
			<p>This is a test picture: <img src="cid:insertImage1" /></p>
			<p>This is a test picture: <img src="cid:insertImage2" /></p>');
    //$c->sendMail($arr, 1);
    return true;
}
if (isset($_GET['nhanMail'])) {
    //include_once('libraries/emailReader.php');
    //$email = new emailReader;
    include_once 'libraries/email5.php';
    $host = 'imap.gmail.com';
    $port = '993';
    $user = '******';
    $pass = '******';
    $connection = pop3_login($host, $port, $user, $pass, $folder = "INBOX", $ssl = true);
    $pop3_stat = pop3_stat($connection);
    $c->_model->_print($pop3_stat);
    $pop3_list = pop3_list($connection);
    $row_pop3_list = $pop3_list[5];
    $c->_model->_print($row_pop3_list);
    $mid = $row_pop3_list['msgno'];
    $pop3_retr = pop3_retr($connection, $mid);
    //$c->_model->_print($pop3_retr);
    /*$pop3_dele = pop3_retr($connection, $row_pop3_list['msgno']);
    	$c->_model->_print($pop3_dele);*/
    $mail_parse_headers = mail_parse_headers($pop3_retr);
    $c->_model->_print($mail_parse_headers);
    $mail_mime_to_array = mail_mime_to_array($connection, $mid, true);
    $c->_model->_print($mail_mime_to_array);
    $part = imap_fetchstructure($connection, $mid);
    $mail_get_parts = mail_get_parts($connection, $mid, $part, 0);
Exemplo n.º 2
0
 $opAccRs = $opAcc->fetch_assoc();
 $conn_security = array('/novalidate-cert', '/ssl', '/tls');
 # Load Bounce Actions
 $bounceActs = json_decode($opAccRs['bounce_actions'], true);
 # Connection
 if ($opAccRs['bounce_acc'] == 0) {
     $inst = pop3_login($opAccRs['pop3_host'], $opAccRs['pop3_port'], $opAccRs['pop3_user'], $opAccRs['pop3_pass'], $folder = 'INBOX', $conn_security[$opAccRs['pop3_secure']]);
 } else {
     $inst = pop3_login($opAccRs['imap_host'], $opAccRs['imap_port'], $opAccRs['imap_user'], $opAccRs['imap_pass'], $folder = 'INBOX', $conn_security[$opAccRs['imap_secure']]);
 }
 if (!$inst) {
     $errRes[] = '* Cannot Connect to Mailbox!';
 } else {
     $cTotal = @imap_num_msg($inst);
     $list = @pop3_list($inst);
     $stat = @pop3_stat($inst);
     $errRes[] = '* Mailbox Connection OK!';
     $errRes[] = '* Total Record: ' . $cTotal;
     $bounceApp = new lethe();
     if (!isset($stat['Unread']) || $stat['Unread'] <= 0 || !isset($stat) || !isset($list)) {
         $stat['Unread'] = 0;
         $errRes[] = '* Mailbox Empty or There No Unread Mail Found!';
     }
     # Fetch
     if ($stat['Unread'] > 0) {
         foreach ($list as $row) {
             $msgHead = imap_fetchheader($inst, $row['msgno'], FT_UID);
             $msgBody = imap_fetchbody($inst, $row['msgno'], FT_UID);
             $emailParser = new PlancakeEmailParser($msgHead);
             # Check Encoding
             $chkEnc = $emailParser->getHeader('Content-Transfer-Encoding');