smiley22 / S22.Imap

A free, easy-to-use and well-documented .NET library component for communicating with IMAP servers
http://smiley22.github.com/S22.Imap/Documentation/
MIT License
211 stars 115 forks source link

No type "Mailmessage" in Mono C# .net core linux application #158

Open DavideC84 opened 4 years ago

DavideC84 commented 4 years ago

Hello everyone, new on Git, just registered to post this.

I am a developing some stuff on Linux, with Mono and C# .net I've imported S22 libraries with Nuget but i'm having a bit of a problem that it's crushing my head. This is the very simple code:

`

public class Mail
{
    ImapClient Client;

    public string Connect(string host, int port, string user, string pwd)
    {
        try
        {
            Client = new ImapClient("imap.gmail.com", 993, user, pwd, AuthMethod.Login, true);
            if (Client != null)
            {
                Console.WriteLine("Connected");
            }
        }

        catch (Exception e)
        {
            return e.ToString();

        }

        return "OK";       
    }

    public void Fetch()
    {

        IEnumerable<uint> uids = Client.Search(SearchCondition.All());
        IEnumerable<MailMessage> messages = Client.GetMessages(uids.FetchOptions.HeadersOnly);
    }

` The problem lies in the Fetch() block (connection works great). I can't compile because of the "IEnumerable messages" declaration. Mailmessage is not a valid type and it's not a class exposed by the S22.Imap lib... I can also use linting and let the compiler show me all the classes available but no MailMessage anywhere. It's so strange i guess is just i'm missing something.. anybody has a clue?

Thanks! Davide

DavideC84 commented 3 years ago

Hi. Yeah man, i probably didn't notice it was a dead project at that time (two years ago). One hour after posting this i've ended up using MailKit indeed. Thanks anyways :-)