Skip to content
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.

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

Open
DavideC84 opened this issue Aug 10, 2019 · 2 comments
Open

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

DavideC84 opened this issue Aug 10, 2019 · 2 comments

Comments

@DavideC84
Copy link

DavideC84 commented Aug 10, 2019

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
Copy link
Author

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 :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@DavideC84 and others