jtrw/imap

library for check email by imap

1.0.1 2022-01-06 15:39 UTC

This package is auto-updated.

Last update: 2024-11-06 22:01:37 UTC


README

Install

composer require jtrw/imap

Example

$imap = new \Jtrw\Imap\Imap("login", "pass", "imap.ukr.net");

$message = $imap->getLastInboxMessage();

$files = $message->getFiles();

$imap->removeMessageByUuid($message->getUuid());

Interface Imap

<?php

namespace Jtrw\Imap;

/**
 *
 */
interface ImapInterface
{
    /**
     * @return int
     */
    public function getCountMessages(): int;
    
    /**
     * @return int
     */
    public function getCountRecentMessages(): int;
    
    /**
     * @return ResponseDto[]
     */
    public function getAllInboxMails(): array;
    
    /**
     * @param int $index
     * @return ResponseDto
     */
    public function getMessageByIndex(int $index): ResponseDto;
    
    /**
     * @param string $uid
     * @return int
     */
    public function getIndexByUuid(string $uid): int;
    
    /**
     * @return ResponseDto|null
     */
    public function getLastInboxMessage(): ?ResponseDto;
    
    /**
     * @return ResponseDto|null
     */
    public function getRecentInboxMessage(): ?ResponseDto;
    
    /**
     * @param string $uuid
     * @return void
     */
    public function removeMessageByUuid(string $uuid): void;
    
    /**
     * @param int $messageNumber
     * @return void
     */
    public function removeMessage(int $messageNumber): void;
    
    /**
     * @param int $messageIndex
     * @param string $folder
     * @return void
     */
    public function moveMessage(int $messageIndex, string $folder = 'INBOX.Processed'): void;
}