Requirement: I have to send file in the email.
Problem: When user taps on the send icon, it calls launchURL method which opens up mail client without any issue.
But if I add file to url variable, it does not attach the file.
launchURL method is given below. I will appreciate any help.
import 'package:url_launcher/url_launcher.dart';
launchURL(toMailId, subject, body, file ) async {
var url = 'mailto:$toMailId?subject=$subject&body=$body'; // This works fine
// var url = 'mailto:$toMailId?subject=$subject&body=$body&file=$file'; // This does not attach the file
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}