Skip to content
pubscout

open_mail

1.2.1, released a year ago by cuboidinc.com

Query device for installed email apps and open them programmatically.

WASM-ready
$ flutter pub add open_mail
Source repository

What it does

A Flutter plugin that queries the device for installed email apps and allows users to open a specific email app or view a picker list. It extends functionality beyond default url_launcher capabilities by letting users choose non-default mail applications.

AI-written summary of version 1.2.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to let users choose which specific email app to open on their device.
  • You need to query the list of installed email apps on Android or iOS.

Skip it when

  • You only need to open a generic mailto link with the default system mail app.

Strengths

  • Supports identifying multiple installed email apps on Android and iOS.
  • Allows opening specific mail apps by name.

Weaknesses

  • Requires manual configuration of LSApplicationQueriesSchemes in iOS Info.plist for app detection.
  • Breaking changes occurred between minor versions (e.g., removal of built-in picker dialog in v1.2.0).

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
3

For iOS, list the URL schemes of the email apps you want to query in your Info.plist file under LSApplicationQueriesSchemes. No additional setup is required for Android.

import 'package:flutter/material.dart';
import 'package:open_mail/open_mail.dart';

void main() {
  runApp(const MaterialApp(home: MyApp()));
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Open Mail App Example'),
      ),
      body: Center(
        child: ElevatedButton(
          onPressed: () async {
            final result = await OpenMail.openMailApp();
            
            if (!result.didOpen) {
              // Handle no mail apps found
            }
          },
          child: const Text("Open Mail App"),
        ),
      ),
    );
  }
}

Alternatives

Packages that do the same job and could replace open_mail.

Works with

Packages commonly used together with open_mail: ones it builds on, ones built on it, and its own family.