email method

void email(
  1. String to, {
  2. String subject = 'New Mail',
})

? Send Email With The Passed String As Email Body

Implementation

void email(String to, {String subject = 'New Mail'}) async {
  if (await canLaunchUrl(
      Uri.parse('mailto:$to?subject=$subject&body=$this'))) {
    launchUrl(Uri.parse('mailto:$to?subject=$subject&body=$this'));
  } else {
    throw Exception('Invalid Email Address');
  }
}