Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't figure out how to list messages in the inbox... #3

Closed
jeffmikels opened this issue Mar 9, 2019 · 2 comments
Closed

Can't figure out how to list messages in the inbox... #3

jeffmikels opened this issue Mar 9, 2019 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@jeffmikels
Copy link

This is the code I'm trying to use, but I always get a "BAD" status when running the fetch.

    ImapClient client = new ImapClient();

    // connect
    ImapResponse response = await client.connect("imap.gmail.com", 993, true);
    print(response.fullResponse);

    client.fetchHandler =
        (String mailboxName, int mailboxNumber, Map<String, String> data) {
      print(mailboxName);
      print(mailboxNumber);
      data.forEach((key, value) {
        print(key);
        print(value);
      });
    };

    // authenticate
    response = await client.authenticate(USERNAME, PASSWORD);
    print(response.status);

    // list folders
    response = await client.list('', '');
    print(response.status);

    response = await client.select('inbox');
    print(response.status);

    response = await client.fetch('1:*', ['BODY']);
    print(response.status);
@michaelspiss
Copy link
Owner

Hi, this is due to the bug in issue #2, but I am finishing up the rework right now!

@michaelspiss michaelspiss added the duplicate This issue or pull request already exists label Mar 9, 2019
@michaelspiss
Copy link
Owner

Fixed with rewrite

I made this part of the official examples, you can view it here:
https://github.com/michaelspiss/imap_client/blob/v1.0.0-alpha/example/fetch.dart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants