Hi,
sorry for my mistake, if you call the command, you don't have to include the "SEARCH" term inside. Here is the correct code once again:
Pavel Azanov
sorry for my mistake, if you call the command, you don't have to include the "SEARCH" term inside. Here is the correct code once again:
string emailServer = "imap.gmail.com";
string email = "name@googlemail.com";
string pass = "password";
bool isUseSsl = true;
int port = 993;
SslProtocols protocol = SslProtocols.Default;
ImapClient imapClient = new ImapClient(emailServer, port, isUseSsl, protocol);
if (imapClient.Connection())
{
bool isLogged = imapClient.LogIn(email, pass);
if (isLogged)
{
Folder folder = imapClient.Folders["INBOX"];
MessageCollection messages = folder.Search("FROM \"name@domain.com\" TEXT \"keyword\"", true);
// ...
}
}
Kind regards,Pavel Azanov