Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMAP Mailbox With File Attachments using PHP Imap Class #12

Open
anandlinast opened this issue Aug 31, 2017 · 0 comments
Open

IMAP Mailbox With File Attachments using PHP Imap Class #12

anandlinast opened this issue Aug 31, 2017 · 0 comments

Comments

@anandlinast
Copy link

https://www.youtube.com/watch?v=xFQxTB0awiU

i did everything but as per source code am not getting any of the mail only getting attached files not each

image

image

my full code

connect('{imap.gmail.com:993/imap/ssl}INBOX', '[email protected]', 'xxxxxx')) { $inbox = $email->getMessages('html'); } //Array of messages ?> <style>
body{
    
    padding: 20px 10px 20px 10px;
}
</style>

email Inbox[email protected]


    <?php
    if($inbox==null){
        
        echo'<h4>Not Connected...</h4>';
        exit;
        
    }else
        
    {
?>        
        <table id="inbox" class="display" cellspacing="0" width="100%">
            
            <thead>
            <tr>
            <th>No</th>
            <th>Subject</th>
            <th>Name</th>
            <th>Email</th>
            <th>Date</th>
            </tr>
            </thead>
            <tbody>
            
            <?php
            $html='';
        $no= 1;
        foreach($inbox as $v);
        {
            $attachment='';
            if(!empty($v=['attachments'])){
                
                foreach($v=['attachments'] as $a){
                    
                    $attachment.='<br><a href="'.$a.'" target="_BLANK">' .end(explode('/',$a)).'</a>';
                }
                }
            $html.='<tr><td>'.$no.'</td>';
            $html.='<td><a href="#" data-message="'.htmlentities($v['message'].(!empty($attachment) ?   '<hr>Attechments:'.$attachment:'')).'" class="message" data-toggle="modal" data-target="#addModal">' .substr($v['subject'],0,120).'</a></td>';
            $html.='<td>'.(empty($v['from']['name'])? '[empty]': $v['from']['name']).'</td>';
            $hmtl.='<td><a href="mailto:'.$v['from']['address'].'?subject=Re:'.$v['subject'].'">'.$v['from']['address'].'</a></td>';
            $hmtl.='<td>'.date('Y-m-d h:i:sa',$v['$date']).'</td></tr>';
            $no++;
        }
        echo $html;
        ?>
    </tbody>
</table>
<?php
    }
  ?>

</div>
</div>
×

message

<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script> <script src="https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script> <script> $(function(){ $('#inbox').Datatable(); $('body').on('click','.message',fuction(){ var message=$(this).data('message'); $('#coeg').html(message); }); }); </script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant