API Reference
The surface of nostr_mail 3.2.x. Full dartdoc lives on
pub.dev.
NostrMailClient.create
static Future<NostrMailClient> create({
required Ndk ndk,
required NostrMailDatabase database,
required Database db,
required BlossomCache blossomCache,
required SyncEngine syncEngine,
List<String>? defaultDmRelays,
List<String>? defaultBlossomServers,
Map<String, String>? nip05Overrides,
OfflineBroadcast? broadcastQueue,
OfflineBlossomUpload? blossomUploadQueue,
String? schedulerDvm,
List<String>? schedulerDvmReadRelays,
})
Sending
Future<void> send({
required List<Recipient> to,
List<Recipient> cc = const [],
List<Recipient> bcc = const [],
required String subject,
required String body,
MailAddress? from,
String? htmlBody,
bool keepCopy = true,
bool signRumor = false,
bool isPublic = false,
})
Future<void> sendMime(
MimeMessage message, {
required List<Recipient> to,
List<Recipient> cc = const [],
List<Recipient> bcc = const [],
bool keepCopy = true,
bool signRumor = false,
bool isPublic = false,
String? mailFrom,
Future<void> Function(Nip01Event event, List<String> relays)? beforePublish,
})
Scheduling
Reading
Labels
Sync and events
Settings
PrivateSettings holds signature, bridges and identities, the last being
RFC 5322 strings usable directly as a From header. The first identity is the
default From address, also exposed as defaultAddress.
Lifecycle
Models
Recipient is sealed: NostrRecipient (a pubkey plus a display
mailAddress) or SmtpRecipient (an address relayed by a bridge).
resolveRecipient({to, ndk, nip05Overrides}) classifies a raw address.
Email: id, senderPubkey, recipientPubkey, isPublic, isBridged,
createdAt, subject, date, from, body, textBody, htmlBody,
attachmentRefs, mime, and the Blossom fields blossomHash,
decryptionKey, decryptionNonce.
EmailSummary: id, senderPubkey, from, fromName, to, cc, bcc,
subject, preview, date, folder, isRead, isStarred, labels,
attachmentRefs, isPublic, isBridged.
PaginatedResult<T>: items, total, offset, hasMore.
ScheduledEmail: the package id, the send time and a
ScheduledEmailStatus.
FailedGiftWrap: the event and its progress (GiftWrapStage,
GiftWrapFailure, attempts).
Exceptions
Constants
recommendedDmRelays and recommendedBlossomServers are the defaults used for
an account with no list of its own.