ddeboer / imap

Object-oriented, fully tested PHP IMAP library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Imap Codeigniter 4

pitikkuning opened this issue · comments

How to get Details Message Inbox on CodeIgniter 4?
My Code :

public function readMail( this number of inbox mail )
{
    $getDetailsMessage     = $this->mailboxInbox->getMessage( this number of inbox mail );

    $data = [
        'title' => 'Baca Email Ci 4',
        'inbox' => $getDetailsMessage
    ];
    return view('readmail', $data);
}

I'm confused about how to retrieve the inbox number

What do you mean by "inbox number"? The mailbox name or the message unique identifier?

Problem Fixed by code :

View :

<a href="<?= base_url() ?>/mailbox/baca-inbox/<?php $noMessage = $getMail->getNumber(); echo $noMessage; ?>"> Baca Email</a>

Routes :

$routes->get('/mailbox/baca-inbox/(:num)', 'Mailbox::readMail/$1');

Controller :

public function readMail($noMessage)
    {
        $getDetailsMessage     = $this->mailboxInbox->getMessage($noMessage);

        $data = [
            'title' => 'Baca Email Ci 4',
            'inbox' => $getDetailsMessage
        ];
        return view('readmail', $data);
    }

Thank you for participating in answering my questions.