mailto 0.1.3 copy "mailto: ^0.1.3" to clipboard
mailto: ^0.1.3 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

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: ['[email protected]'],
    cc: ['[email protected]', '[email protected]'],
    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.

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 ..

119
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