mail static method

Future<bool> mail({
  1. String toAddress = "",
  2. String subject = "",
  3. String body = "",
  4. OpenMode mode = OpenMode.platformDefault,
})

share content to mail

Implementation

static Future<bool> mail(
    {String toAddress = "",
    String subject = "",
    String body = "",
    OpenMode mode = OpenMode.platformDefault}) async {
  try {
    return await launchUrl(
        Uri(
            scheme: 'mailto',
            path: toAddress,
            query: _encodeQueryParameters(
                <String, String>{'subject': subject, 'body': body})),
        mode: _getLaunchMode(mode));
  } catch (e) {
    log(e.toString());
    return false;
  }
}