flutter_emailer 0.0.4
flutter_emailer: ^0.0.4 copied to clipboard
This plugin in to open mail and send mail with different cases
Flutter Emailer Plugin #
A Flutter plugin for opening email applications and sending emails with various use cases.
Features #
The plugin supports the following functionalities:
- Open the default email application.
- Send emails to single or multiple recipients.
- Include CC and BCC recipients.
- Add a subject or body to the email.
Available Methods #
-
Open email application:
openEmailApp()
-
Single receiver without subject:
openEmailWithForSingleReceiverOnly(String receiverEmailId, List<String>? cc, List<String>? bcc)
-
Multiple receivers without subject:
openEmailWithForMultipleReceiverOnly(List<String> receiverEmailIdList, List<String>? cc, List<String>? bcc)
-
Single receiver with subject:
openEmailWithForSingleReceiverWithSubject(String receiverEmailId, String subject, List<String>? cc, List<String>? bcc)
-
Multiple receivers with subject:
openEmailWithForMultipleReceiverWithSubject(List<String> receiverEmailIdList, String subject, List<String>? cc, List<String>? bcc)
-
Email with body only:
openEmailWithBodyOnly(String body, List<String>? cc, List<String>? bcc)
Permissions #
Android #
- Add the following permissions to your
AndroidManifest.xml
file:
<queries>
<intent>
<action android:name="android.intent.action.SENDTO" />
<data android:scheme="mailto" />
</intent>
</queries>
Ios #
- Add the following permissions to your
info.plist
file:
<dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>mailto</string>
</array>
</dict>
Implementation #
- To use this package, add the package to your pubspec.yaml file:
dependencies:
flutter_emailer: ^0.0.1
- Import the package:
import 'package:flutter_emailer/flutter_emailer.dart';
- Usage:
void _openEmailWithSubject() async {
try {
await FlutterEmailer.openEmailWithForSingleReceiverWithSubject('receiverEmail@gmail.com',"Test Subject");
} catch (e) {
debugPrint('Error: $e');
}
}
Developed by:
Ruchita Bhaskar
Personal email - ruchita.bhaskar@gmail.com
Work email - ruchitab@fermion.in
LinkedIn - https://www.linkedin.com/in/ruchita-bhaskar-823488180
Publisher's LinkedIn - https://www.linkedin.com/company/fermioninfotech?trk=profile-position