gpt4 book ai didi

email - flutter 的电子邮件发件人

转载 作者:行者123 更新时间:2023-12-05 02:11:57 25 4
gpt4 key购买 nike

当我在 flutter 中从表单发送电子邮件时出现此错误。

Unhandled Exception: PlatformException(UNAVAILABLE, defualt mail app not available, null)
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: true,

attachments: [ 'path/to/image.png', ],
);

await FlutterMailer.send(mailOptions);

String platformResponse;

try {
await FlutterMailer.send(mailOptions);
platformResponse = 'success';
} catch (error) {
platformResponse = error.toString();
}

if (!mounted) return;
_scafoldKey.currentState.showSnackBar(SnackBar(
content: Text(platformResponse),
));
}

最佳答案

我在 iPhone 上遇到了同样的问题,这是因为我没有设置默认的 iOS 默认邮件应用程序。

关于email - flutter 的电子邮件发件人,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56753939/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com