Move email using MailKit Pop3

1.9k views Asked by At

I'm using MailKit.Net.Pop3.Pop3Client to access the email account, so far every thing is OK.

Now I'm trying to move an email message to another folder and can't find a way to do it. Anyone know how?

using (var client = new MailKit.Net.Pop3.Pop3Client())
{
    client.Connect("server", 995, true);
    client.Authenticate("username", "password");

    int count = client.GetMessageCount();
    for (int i = 0; i < count; i++)
    {
        var message = client.GetMessage(i);
        if (message.Subject.Contains("Test"))
        {
            //Move email here
            //Ex: MoveTo INBOX\Test
        }
    }

    client.Disconnect(true);
}

PS: What I want is not client.DeleteMessage(i)

1

There are 1 answers

1
nobody On BEST ANSWER

You can't do that. POP3 has no concept of server-side folders. There is only the one (inbox). Maybe the server also offers IMAP?