I use laravel imap.
I am fetchting the mails of a mailbox, which works great.
I need to display an information whether mails have an attachment.
For this I was using this code, which WORKED:
$aMessage = $selectedFolder->messages()->setFetchFlags(true)
->setFetchAttachment(true)->setFetchBody(true)->leaveUnread()->limit(40, $highest_page)->get();
The Problem is the load times were bad. To fix this I set setFetchBody to false, which greatly improved the load time. I dont need the body in the overview anyway:
$aMessage = $selectedFolder->messages()->setFetchFlags(true)
->setFetchAttachment(true)->setFetchBody(false)->leaveUnread()->limit(40, $highest_page)->get();
Now even with setFetchAttachment(true) the attachment information is lost.
$oMessage->hasAttachments()
always returns false
.
If I switch back setFetchBody
to true
it works.
setFetchAttachment
does not seem to do anything.
What am I doing wrong?