Quantcast
Channel: ImapX 2
Viewing all articles
Browse latest Browse all 1952

New Post: How to Search The Particular Keyword From the Specified Email Address

$
0
0
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:
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

Viewing all articles
Browse latest Browse all 1952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>