I am trying to fetch E-Mails with a specific Address, for that I am fetching all the Addresses in the Database and foreach' any to the specific Mailbox. When I manually input the Address, it works properly $search->addCondition(new Ddeboer\Imap\Search\Email\From('mail@mail.eu')); or $messages = $mailbox->getMessages(new RawExpression('From "mail@mail.eu"'));. When I input the Variable as Mail, all the Mailboxes-Messages are fetched [both in SearchExpression aswell as RawExpression].
Summary
Variable in Search not working properly.
Current behavior
I am trying to fetch E-Mails with a specific Address, for that I am fetching all the Addresses in the Database and foreach' any to the specific Mailbox. When I manually input the Address, it works properly
$search->addCondition(new Ddeboer\Imap\Search\Email\From('mail@mail.eu'));
or$messages = $mailbox->getMessages(new RawExpression('From "mail@mail.eu"'));
. When I input the Variable as Mail, all the Mailboxes-Messages are fetched [both in SearchExpression aswell as RawExpression].$messages = $mailbox->getMessages(new RawExpression('From "'.$Email.'"'));
There is a SO-Post, that also did not work [https://stackoverflow.com/questions/5086362/using-variables-in-imap-search-criteria].Expected behavior
Only the E-Mails with the specified Filter shall be visible.
Kind regards, Lukas-Adrian