Last updated:
0 purchases
mail sender
mail_sender #
A Flutter plugin to send pre-filled emails from your Flutter app.
Prefill the email's body, subject, recipients and more.
Features #
Prefill the email's body, subject, recipients and more.
Supports attachments.
Platform Support #
Android
iOS
MacOS
Web
Linux
Windows
✔️
✔️
Getting started #
Add the following to your pubspec.yaml file:
dependencies:
mail_sender: ^version
copied to clipboard
Import the package:
import 'package:mail_sender/mail_sender.dart';
copied to clipboard
In your main.dart file, add the following code:
final _mailSenderPlugin = MailSender();
_mailSenderPlugin.sendMail(
recipient: ["[email protected]", "[email protected]"],
subject: "Leave Application",
body: "Some lengthy Body text",
bcc: ["[email protected]"],
cc: ["[email protected]", "[email protected]"],
attachment: targetFile.path,
);
copied to clipboard
Android: Add the following to your AndroidManifest.xml file:
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
copied to clipboard
Create a new file provider_paths.xml in android/app/src/main/res/xml folder and add the following code:
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<files-path name="app_flutter_files" path="../app_flutter/" />
</paths>
copied to clipboard
iOS: No configuration required.
Additional information #
Currently, the package is only tested on Android and iOS. If you want to use it on other platforms, please create an issue or contribute by creating a Pull request.
Currently, the package has some limitations, like it only supports single attachment, and iOS only supports adding PDF in attachments. We will add these features as well in the near future. If you want to add more features, please create an issue or contribute by creating a Pull request.
Use our example to get an idea of how to use the package. If you have any questions, please create an issue.
Future Plans #
Add support for more file types in iOS.
Add support for multiple attachments.
Add support for more platforms.
You can also click on the "Thumb up" button of the top of the pub.dev page if you find this Package helpful. #
Team CREO IT #
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.