-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setFetchAttachment(true) doesn't do anything if setFetchBody(false) #277
Comments
I dont fully understand why, but if I include Case one: The relevant line was commented out. In this case
Case two: The relevant line is present. In this case
Well it seems my issue is solved, but I dont fully understand why. Just in case here is the whole code, which I use to loop through all messages in a mailbox and build my respose:
|
Hi @SDCRoman , Kind Regards |
But I am not fetching the body in the working example. In theory it should not work, but it does.
Well. I ditched the I understand now that the attachment information is in the body. I still dont understand why I found a better way to check for attachments. I dont include the whole parsed body into the response. I check in the server whether the attachment array in the parsed body has a greater length then 0. So far everything seems to work for me:
|
Please update to v2.0.0 :) |
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 returnsfalse
.If I switch back
setFetchBody
totrue
it works.setFetchAttachment
does not seem to do anything.What am I doing wrong?
The text was updated successfully, but these errors were encountered: