发送带附件的电子邮件 Flutter(IOS)

Send Email With Attachment Flutter(IOS)

我在 flutter 中发送电子邮件时遇到问题(IOS)。我使用 flutter_email_sender 库。

Future<void> send() async {
    final Email email = Email(
      body: _bodyController.text,
      subject: _subjectController.text,
      recipients: [_recipientController.text],
      attachmentPath: attachment,
      isHTML: isHTML,
    );
    await FlutterEmailSender.send(email);
  }

button... onPressed: send()
==> Unhandled Exception: PlatformException(not_available, No email clients found!, null)

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

https://pub.dev/packages/mailer Android/iOS 我都在用这个。他们两个都没有问题。 这是一个维护良好的包。