Closed webdevhouse closed 5 years ago
Hey! Welcome to the almighty GitHub. Ill be sure to look at this when I get home. I can currently coming back from vaction. Ill let you know
Thank you!
I can confirm that MAILER-DAEMON type emails cause an error:
Fatal error: Cannot access empty property in /php-imap-client-master/ImapClient/IncomingMessage.php on line 366
@sergey144010 wrote that. @sergey144010 ping if you would
I do have the same Error when just simply use this code:
$emails = $imap->getMessages();
so this is a bug and will be fixed? (first post on github, since ever :D )
This may be due yo no messages being their at all
There are about 2600 emails in the inbox folder, so I think that's not the problem
Hmm I will look into this again
To Help you a little bit, thats the code which I use `$mailbox = 'von-gerle.de'; $username = 'myUsername'; $password = 'myPassword'; $encryption = Imap::ENCRYPT_SSL; // TLS OR NULL accepted
$imap = new Imap($mailbox, $username, $password, $encryption);
$folders = $imap->getFolders();
$output = '';
foreach($folders as $folder) {
echo $folder;
}
// Select the folder INBOX
$imap->selectFolder('INBOX');
$overallMessages = $imap->countMessages();
$unreadMessages = $imap->countUnreadMessages();
$emails = $imap->getMessages();`
$overallMessages and $unreadMessages work like expected, just $emails give me the error. Of course I set the right Username and Password =)
Hey do you mind updating an re running your code to make sure the lines march up again
okay, i've updated it, but still the same error.
it still echos from line 364 correct?
maybe this can help you a bit:
that means its 366 not 364
The message is cannot access empty ???
sorry, yes the messages is "cannot access empty property"
Try and remove the \
Ah! I got it! Remvoe the $ fro, subtype on that line! Let me know
i did, now i get this 'Call to a member function __get() on null' In Line 377 maybe because there is also an $ before subtype
okay, after i removed the $ in both lines (366, 377) i got the "cannot access empty property" but this time for line 699
I will download the code tommrow after school and fully fix this
Please, update your code with my leastest commits
I am sorry that I have to ask, but how do I update with your commit ? I use composer
Edit, saw that you committed in master branch, I know what to do now
No problem :) I don't remember the command by heart myself lol. Try composer update. If not just Google it lol
Did that fix the issue?
Herooooooooo????????
Hi the warning on line 699 is still occurring (and some others warnings); in attachment is output from: var_dump($typeMessage);echo("\n\n"); var_dump($this->message); die; in coding IncomingMessage.php & ln 699; there is no $this->message->typeMessage->structure existing
I will look into this later.
May I see the full stack trace and error? Screenshots are okay
there is what I get: PHP Warning: Creating default object from empty value in /home/aaa/utils/rf-vypisy/php-imap-client/ImapClient/IncomingMessage.php on line 385 PHP Notice: Undefined property: stdClass::$typeMessage in /home/aaa/utils/rf-vypisy/php-imap-client/ImapClient/IncomingMessage.php on line 699 PHP Notice: Trying to get property of non-object in /home/aaa/utils/rf-vypisy/php-imap-client/ImapClient/IncomingMessage.php on line 699 PHP Notice: Trying to get property of non-object in /home/aaa/utils/rf-vypisy/php-imap-client/ImapClient/IncomingMessage.php on line 699 PHP Notice: Undefined property: stdClass::$typeMessage in /home/aaa/utils/rf-vypisy/php-imap-client/ImapClient/IncomingMessage.php on line 699 PHP Notice: Trying to get property of non-object in /home/aaa/utils/rf-vypisy/php-imap-client/ImapClient/IncomingMessage.php on line 699 PHP Notice: Trying to get property of non-object in /home/aaa/utils/rf-vypisy/php-imap-client/ImapClient/IncomingMessage.php on line 699
2017-10-07 16:53 GMT+02:00 Matthew Parks notifications@github.com:
May I see the full stack trace and error? Screenshots are okay
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SSilence/php-imap-client/issues/187#issuecomment-334940540, or mute the thread https://github.com/notifications/unsubscribe-auth/APLGv5jgRYpTv7jvKxh91AXL_CkpQBUEks5sp5CFgaJpZM4O5PZB .
hey there! I got the same problem and the solution is quiet easy in getBody() in IncomingMessage.php
Some Mails don't have a plaintext mailbody. So you would try to give $objNew a NULL property! That is the problem, my code is a possible solution. Greetz and keep up the good work!
Edit: This is also in the official docs: http://php.net/manual/en/function.imap-fetch-overview.php#25978
I am having a separate but very similar issue on line 708 of that file:
Notice: Trying to get property of non-object in ... /ImapClient/IncomingMessage.php line 708
I am just trying to set it up, so I am unsure if it is a real bug or I have not setup my connection correctly yet...
Hey, can you share your connection code?
Using the advanced constructor;
new ImapClient([
'flags' => [
'service' => ImapConnect::SERVICE_IMAP,
'encrypt' => ImapConnect::ENCRYPT_SSL,
'validateCertificates' => ImapConnect::NOVALIDATE_CERT,
],
'mailbox' => [
'remote_system_name' => "<host>.com",
],
'connect'=>[
'username'=>"<username>",
'password'=>"<password>"
]
])
It may be trying to use an ssl connection and ignoring certification
I am having the same issue where after $emails = $imap->getMessages();
it breaks. But this is only happening to me when I access a office365 account. I tried adding wp-entwickler-at suggestion but that didn't work.
Hey there, It's my first post at Github at all.
I have this issue when in my mailbox are emails from mailer deamons of type - email couldn't be delivered etc. When I delete this feedback message everythings starts to work again.
Do u need something more?