Skip to content
pubscout

mailer

7.3.0, released 12 days ago by an unverified publisher

Send emails via SMTP with support for HTML, attachments, and TLS.

$ flutter pub add mailer
Source repository

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.