Dart Quickstart
Send your first email with the Mailofly Dart SDK. Requires: Dart 3.0+ (Flutter compatible) · API key · Account key1. Install
2. Send an email
3. Check mail logs
Next
- Dart SDK — full reference
- Sending examples
- API: Emails
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
dart pub add mailofly
import 'dart:io';
import 'package:mailofly/mailofly.dart';
void main() async {
final client = Mailofly(apiKey: Platform.environment['MAILOFLY_API_KEY']!);
final result = await client.emails.send(
from: 'Acme <onboarding@example.com>',
to: 'you@example.com',
subject: 'Hello from Mailofly',
html: '<p>It works!</p>',
);
print('Sent: ${result['id']}');
client.close();
}
await client.mailLogs.list(page: 1, pageSize: 10);