// Create PhpImap\Mailbox instance for all further actions
$mailbox = new PhpImap\Mailbox(
'{imap.gmail.com:993/imap/ssl}INBOX', // IMAP server and mailbox folder
'some@gmail.com', // Username for the before configured mailbox
'*********', // Password for the before configured username
__DIR__, // Directory, where attachments will be saved (optional)
'UTF-8', // Server encoding (optional)
true, // Trim leading/ending whitespaces of IMAP path (optional)
true // Attachment filename mode (optional; false = random filename; true = original filename)
);
Or any time later in the code:
// set attachment filename mode to "original filename"
$mailbox->setAttachmentFilenameMode(true);
You also can get the current configuration:
// get current attachment filename mode
// true => original filename
// false => random filename (default; old known behaviour by this library)
$mailbox->getAttachmentFilenameMode();
Either directly in the constructor:
Or any time later in the code:
You also can get the current configuration:
Resolves #589.