// composer packages load
require_once "vendor/autoload.php";
use PhpImap\Exceptions\ConnectionException;
use PhpImap\Mailbox;
$mailbox = new Mailbox(
'{imap.yandex.com.tr:993/imap/ssl/novalidate-cert}INBOX', // IMAP server and mailbox folder
'gdemir3327@yandex.com', // Username for the before configured mailbox
'********', // Password for the before configured username
__DIR__ . '/upload/', // Directory, where attachments will be saved (optional)
'UTF-8', // Server encoding (optional)
true, // Trim leading/ending whitespaces of IMAP path (optional)
false // Attachment filename mode (optional; false = random filename; true = original filename)
);
// Save attachments one by one
if (!$mailbox->getAttachmentsIgnore()) {
$attachments = $email->getAttachments();
Screenshots / Outputs
Fatal error: Uncaught Error: Call to undefined method PhpImap\Mailbox::getAttachmentsIgnore() in /var/www/vhosts/httpdocs/ir/index.php:47 Stack trace: #0 {main} thrown in /var/www/vhosts/httpdocs/ir/index.php on line 47
The used code:
Screenshots / Outputs Fatal error: Uncaught Error: Call to undefined method PhpImap\Mailbox::getAttachmentsIgnore() in /var/www/vhosts/httpdocs/ir/index.php:47 Stack trace: #0 {main} thrown in /var/www/vhosts/httpdocs/ir/index.php on line 47