All Projects → taljacobson → flutter_mailer

taljacobson / flutter_mailer

Licence: MIT license
A wrapper on top of MFMailComposeViewController from iOS and Mail Intent on android

Programming Languages

dart
5743 projects
java
68154 projects - #9 most used programming language
objective c
16641 projects - #2 most used programming language
HTML
75241 projects
ruby
36898 projects - #4 most used programming language
swift
15916 projects

Projects that are alternatives of or similar to flutter mailer

E-commerce
A Flutter E-commerce by implementing the Carousel and other flutter components
Stars: ✭ 36 (-16.28%)
Mutual labels:  flutter-plugin
navigate
A flutter plugin for byutifull navigation with advanced routing
Stars: ✭ 40 (-6.98%)
Mutual labels:  flutter-plugin
flutter rtmppublisher
Publisher to rtmp using the camera plugin as a basis to do all the basic camera/record management.
Stars: ✭ 86 (+100%)
Mutual labels:  flutter-plugin
FlutterLoadingGIFs
Loading indicator GIFs. Material and Cupertino (Android and iOS) loading indicators in assorted sizes. Use as placeholders for loading remote image assets. Demo: https://gallery.codelessly.com/flutterwebsites/loadinggifs/
Stars: ✭ 28 (-34.88%)
Mutual labels:  flutter-plugin
flutter wasm
WebAssembly interpreter for Flutter apps.
Stars: ✭ 22 (-48.84%)
Mutual labels:  flutter-plugin
flutter scan
scanner qrcode in widget tree & decoder qrcode from image
Stars: ✭ 63 (+46.51%)
Mutual labels:  flutter-plugin
plugins
Flutter plugins for Tizen
Stars: ✭ 40 (-6.98%)
Mutual labels:  flutter-plugin
pal-widgets
A collection of widgets for making amazing onboarding experience in your flutter applications
Stars: ✭ 21 (-51.16%)
Mutual labels:  flutter-plugin
flutter isolate
Launch an isolate that can use flutter plugins.
Stars: ✭ 157 (+265.12%)
Mutual labels:  flutter-plugin
amap all fluttify
高德地图 Flutter插件
Stars: ✭ 39 (-9.3%)
Mutual labels:  flutter-plugin
flutter-google-api-availability
Check the availability of Google Play services on the current device
Stars: ✭ 26 (-39.53%)
Mutual labels:  flutter-plugin
davinci
A flutter package to convert any widget to an Image.
Stars: ✭ 33 (-23.26%)
Mutual labels:  flutter-plugin
gen lang
gen_lang is a dart library for internationalization. Extracts messages to generate dart files required by Intl, inspired by Intl_translation and Flutter i18n
Stars: ✭ 94 (+118.6%)
Mutual labels:  flutter-plugin
liquid button
Liquify your buttons, web demo at website
Stars: ✭ 18 (-58.14%)
Mutual labels:  flutter-plugin
swipedetector
A Flutter package to detect up, down, left, right swipes.
Stars: ✭ 34 (-20.93%)
Mutual labels:  flutter-plugin
pal-plugin
The Flutter onboarding editor
Stars: ✭ 16 (-62.79%)
Mutual labels:  flutter-plugin
flutter-geocoding
A Geocoding plugin for Flutter
Stars: ✭ 88 (+104.65%)
Mutual labels:  flutter-plugin
mailbag
A tool for creating and managing Mailbags, a package for preserving email using multiple preservation formats
Stars: ✭ 29 (-32.56%)
Mutual labels:  email
survey kit
Flutter library to create beautiful surveys (aligned with ResearchKit on iOS)
Stars: ✭ 68 (+58.14%)
Mutual labels:  flutter-plugin
flutter beacon
An hybrid iBeacon scanner and transmitter SDK for Flutter Android and iOS.
Stars: ✭ 92 (+113.95%)
Mutual labels:  flutter-plugin

flutter_mailer

pub package

Share email content via device Email Client - supports multiple Attachments

Simple & quick plugin for cross application data sharing of email fields in mobile development.

Flutter Mailer example app

Supports:

  • android
  • ios

Getting Started

Add to your pubspec dependencies, like so:

dependencies:
  flutter:
    sdk: flutter
  flutter_mailer: ^2.0.0

Instantiate mail options as follows:

send email

import 'package:flutter_mailer/flutter_mailer.dart';

...
...

final MailOptions mailOptions = MailOptions(
  body: 'a long body for the email <br> with a subset of HTML',
  subject: 'the Email Subject',
  recipients: ['[email protected]'],
  isHTML: true,
  bccRecipients: ['[email protected]'],
  ccRecipients: ['[email protected]'],
  attachments: [ 'path/to/image.png', ],
);

final MailerResponse response = await FlutterMailer.send(mailOptions);
switch (response) {
  case MailerResponse.saved: /// ios only
    platformResponse = 'mail was saved to draft';
    break;
  case MailerResponse.sent: /// ios only
    platformResponse = 'mail was sent';
    break;
  case MailerResponse.cancelled: /// ios only
    platformResponse = 'mail was cancelled';
    break;
  case MailerResponse.android:
    platformResponse = 'intent was successful';
    break;
  default:
    platformResponse = 'unknown';
    break;
}

note gmail and other apps Might parse HTML out of the body.

[Android] check if app is installed.

use full if you want to send the intent to a specific App. returns false on [IOS]

const GMAIL_SCHEMA = 'com.google.android.gm';

final bool gmailinstalled =  await FlutterMailer.isAppInstalled(GMAIL_SCHEMA);

if(gmailinstalled) {
  final MailOptions mailOptions = MailOptions(
    body: 'a long body for the email <br> with a subset of HTML',
    subject: 'the Email Subject',
    recipients: ['[email protected]'],
    isHTML: true,
    bccRecipients: ['[email protected]'],
    ccRecipients: ['[email protected]'],
    attachments: [ 'path/to/image.png', ],
    appSchema: GMAIL_SCHEMA,
  );
  await FlutterMailer.send(mailOptions);
}

[IOS] check if device has the ability to send email

this package uses MFMailComposeViewController for [IOS] which requires the default mail App. if none is installed you might want to revert to use url_launcher returns false on [Android]

  final bool canSend = await FlutterMailer.canSendMail();

  if(!canSend && Platform.isIos) {
    final url = 'mailto:$recipient?body=$body&subject=$subject';
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'Could not launch $url';
    }
  }
}

For help getting started with Flutter, view official online documentation.

For help on editing plugin code, view the documentation.

based off of react-native-mail

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].