mailto 0.1.4 copy "mailto: ^0.1.4" to clipboard
mailto: ^0.1.4 copied to clipboard

outdated

Simple Dart package for creating mailto links in your Flutter apps

mailto #

Simple Dart package for creating mailto links in your Flutter apps

This package helps you build mailto links and use those mailto links to launch the phone's email client with certain fields pre-filled, while taking care of encoding every fields properly.

The mailto package:

  • supports one or many to, cc, and bcc fields
  • supports custom body and subject for the emails
  • encodes every value for your correctly
  • is blazingly fast 😜

smaho-engineering/mailto

Build Status Code coverage

mailto GitHub Stars Count

Usage #

Most likely, you want to launch the email client on the phone with certain fields pre-filled.

import 'package:mailto/mailto.dart';
// Optional, but most likely what you want
import 'package:url_launcher/url_launcher.dart';

// Somewhere in your app
launchMailto() async {
  final mailtoLink = Mailto(
    to: ['to@example.com'],
    cc: ['cc1@example.com', 'cc2@example.com'],
    subject: 'mailto example subject',
    body: 'mailto example body',
  );
  // Convert the Mailto instance into a string.
  // Use either Dart's string interpolation
  // or the toString() method.
  await launch('$mailtoLink');
}

Use url_launcher for launching the links you create with the mailto package.

The package currently does not follow RFC 6068 - The 'mailto' URI Scheme, but it's planned to make sure that the package works well on all platforms and with all email clients.

Contribute #

Tests #

We use the test package for writing and running tests.

Run the test locally by pub run test.

Format #

We use the dartfmt tool to automatically format our code in a way that follows the Dart guidelines.

Format your code by executing dartfmt -w ..

128
likes
0
pub points
97%
popularity

Publisher

verified publishersmaho.dev

Simple Dart package for creating mailto links in your Flutter apps

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

meta

More

Packages that depend on mailto