当我从 flutter 中的表单发送电子邮件时出现此错误。
Unhandled Exception: PlatformException(UNAVAILABLE, defualt mail app not available, null)
Run Code Online (Sandbox Code Playgroud)
class _MyAppState extends State<MyApp> {
List<String> attachment = <String>[];
TextEditingController _subjectController =
TextEditingController(text: 'ct');
TextEditingController _bodyController = TextEditingController(
text: ''' a
''');
final GlobalKey<ScaffoldState> _scafoldKey = GlobalKey<ScaffoldState>();
// Platform messages are asynchronous, so we initialize in an async method.
Future<void> send() async {
// Platform messages may fail, so we use a try/catch PlatformException.
final MailOptions mailOptions = MailOptions(
body: 'Ro',
subject: 'the Email Subject',
recipients: ['rodrigo@houlak.com'],
isHTML: …Run Code Online (Sandbox Code Playgroud)