Skip to content

Commit

Permalink
release v0.0.26
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Virkus committed Jun 16, 2020
1 parent 390b24e commit e01e361
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.0.26
- Added high level `MailClient` API
- Downgraded XML dependency to be compatible with flutter_test again
- Fixed `ImapClient`'s `eventBus` registration when this is specified outside of ImapClient.

## 0.0.25
- Add support to discover email settings using the `Discover` class.

Expand Down
55 changes: 51 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,58 @@
An experimental IMAP, POP3 and SMTP client for Dart developers.
Experimental IMAP, POP3 and SMTP clients for Dart developers.

Available under the commercial friendly
[MPL Mozilla Public License 2.0](https://www.mozilla.org/en-US/MPL/).

## Usage
## High Level API Usage

A simple usage example:
A simple usage example for using the high level API:

```dart
import 'dart:io';
import 'package:enough_mail/enough_mail.dart';
String userName = 'user.name';
String password = 'password';
void main() async {
await mailExample();
}
Future<void> mailExample() async {
var email = userName + '@domain.com';
var config = await Discover.discover(email);
var incoming = MailServerConfig()
..serverConfig = config.preferredIncomingServer
..authentication = PlainAuthentication(userName, password);
var account = MailAccount()
..email = email
..incoming = incoming;
//TODO specify outgoing server configuration
var mailClient = MailClient(account, isLogEnabled: false);
await mailClient.connect();
var mailboxesResponse =
await mailClient.listMailboxesAsTree(createIntermediate: false);
if (mailboxesResponse.isOkStatus) {
print(mailboxesResponse.result);
await mailClient.selectInbox();
var fetchResponse = await mailClient.fetchMessages(count: 20);
if (fetchResponse.isOkStatus) {
for (var msg in fetchResponse.result) {
printMessage(msg);
}
}
}
mailClient.eventBus.on<MailLoadEvent>().listen((event) {
print('New message at ${DateTime.now()}:');
printMessage(event.message);
});
mailClient.startPolling();
}
```

## Low Level Usage

A simple usage example for using the low level API:

```dart
import 'dart:io';
Expand Down Expand Up @@ -155,7 +202,7 @@ Add this dependency your pubspec.yaml file:

```
dependencies:
enough_mail: ^0.0.24
enough_mail: ^0.0.26
```
The latest version or `enough_mail` is [![enough_mail version](https://img.shields.io/pub/v/enough_mail.svg)](https://pub.dartlang.org/packages/enough_mail).

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: enough_mail
description: IMAP, POP3 and SMTP clients in pure Dart. Provides low level support for these mail protocols.
version: 0.0.25
version: 0.0.26
homepage: https://github.com/Enough-Software/enough_mail

environment:
Expand Down

0 comments on commit e01e361

Please sign in to comment.