You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use ESP8266 mini board, latest ESP_Mail_Client version.
I use the code below to search for a specific subject content. There are two options, either system Mac address ot a predefined userEmail. The app uses Gmail.
When app calls serchSubject function to search for Mac address and no email found in Gmail inbox, on the serial optput I get #### Searching messages...
no messages found for the specified search criteria.
When app calls serchSubject function to search for userEmail, I get: #### Searching messages...
if (!MailClient.readMail(&imap, false))
{
String errorMsg = imap.errorReason();
Serial.print(F("---> directly from IMAP client error code: "));
Serial.println(imap.errorCode());
}
for (int i = 0; i < max_result; i++)
{
imap_data.search.criteria.clear();
// Now Fech message by UID stored in msg_uid
imap_data.fetch.uid = msg_uid[i];
MailClient.readMail(&imap, false /* session open for fetching message in opened mailbox later */);
}
imap.closeSession();
imap.empty();
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I use ESP8266 mini board, latest ESP_Mail_Client version.
I use the code below to search for a specific subject content. There are two options, either system Mac address ot a predefined userEmail. The app uses Gmail.
When app calls serchSubject function to search for Mac address and no email found in Gmail inbox, on the serial optput I get #### Searching messages...
no messages found for the specified search criteria.
When app calls serchSubject function to search for userEmail, I get: #### Searching messages...
Error, SEARCH not allowed now.
---> directly from IMAP client error code: -203
Why? What is wrong? what is the defference?
char userEmail[50];
void serchSubject(bool specialUser)
{
if (specialUser)
{
IMAP_Setup(false);
}
imap_data.fetch.uid.clear();
imap_data.fetch.number.clear();
imap_data.fetch.sequence_set.string.clear();
if (specialUser)
{
imap_data.search.criteria = F("SEARCH SUBJECT ") + WiFi.macAddress();
}
else
{
imap_data.search.criteria = F("SEARCH SUBJECT ") + String(userEmail);
}
Serial.print(F("---> Search criteria: "));
Serial.println(imap_data.search.criteria.c_str());
if (!MailClient.readMail(&imap, false))
{
String errorMsg = imap.errorReason();
Serial.print(F("---> directly from IMAP client error code: "));
Serial.println(imap.errorCode());
}
for (int i = 0; i < max_result; i++)
{
imap_data.search.criteria.clear();
// Now Fech message by UID stored in msg_uid
imap_data.fetch.uid = msg_uid[i];
MailClient.readMail(&imap, false /* session open for fetching message in opened mailbox later */);
}
imap.closeSession();
imap.empty();
}
Beta Was this translation helpful? Give feedback.
All reactions