mailer
7.3.0, released 12 days ago by an unverified publisher
Send emails via SMTP with support for HTML, attachments, and TLS.
What it does
Provides a Dart API to compose email messages, attach files or inline images, and transmit them through an existing SMTP server. Includes address validation and secure connection handling.
AI-written summary of version 7.2.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to send transactional or notification emails directly from a Dart/Flutter backend
- You require attachment or HTML email support without a third‑party service
Skip it when
- Running in Flutter Web (no raw socket support)
- You need inbound email handling or an SMTP server
Strengths
- Supports TLS/SSL and CHUNKING for large attachments
- Built‑in address validators and pre‑configured services (Gmail, Yahoo, etc.)
- Allows persistent connections for bulk sending
Weaknesses
- Cannot be used on the client side in browsers
- Requires managing SMTP credentials securely
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 9
import 'package:mailer/mailer.dart';
import 'package:mailer/smtp_server.dart';
void main() async {
var smtpServer = gmail('user@gmail.com', 'appPassword');
var message = Message()
..from = Address('user@gmail.com', 'Your Name')
..recipients.add('dest@example.com')
..subject = 'Test'
..text = 'Hello from Dart!';
await send(message, smtpServer);
}Works with
Packages commonly used together with mailer: ones it builds on, ones built on it, and its own family.
- cryptomailer depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- mimemailer depends on itUtilities to resolve MIME types from file names, magic bytes, and to parse multipart streams.
- asyncmailer depends on itUtility classes and helpers that extend Dart's async library.
- intlmailer depends on itA Dart library for internationalization and localization, providing message translation, plural/gender handling, and date/number formatting.
- loggingmailer depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- unorm_dartmailer depends on itUnicode normalization for Dart supporting NFC, NFD, NFKC, and NFKD forms.
- punycodermailer depends on itPure Dart implementation of the RFC 3492 Punycode specification for encoding and decoding.
- finchBuilt on mailerA lightweight Dart framework for building server‑side web apps, APIs, databases and WebSockets.