ddeboer / imap

Object-oriented, fully tested PHP IMAP library
MIT License
888 stars 253 forks source link

Imap Codeigniter 4 #554

Closed pitikkuning closed 1 year ago

pitikkuning commented 1 year ago

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

Slamdunk commented 1 year ago

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

pitikkuning commented 1 year ago

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.