Search docs/

Email Composer

Requires Cordova plugin: cordova-plugin-email-composer. For more info, please see the Email Composer plugin docs.

https://github.com/katzer/cordova-plugin-email-composer

Premier Version Available

Featuring regular release cycles, security and bug fixes, and guaranteed SLAs.

Available here

Installation

ionic cordova plugin add cordova-plugin-email-composernpm install @ionic-native/email-composer
Ionic Native Enterprise comes with fully supported and maintained plugins from the Ionic Team. Learn More or if you're interested in an enterprise version of this plugin Contact Us

Supported Platforms

  • Amazon Fire OS
  • Android
  • Browser
  • iOS
  • Windows
  • macOS

Usage

import { EmailComposer } from '@ionic-native/email-composer/ngx';

constructor(private emailComposer: EmailComposer) { }

...


this.emailComposer.isAvailable().then((available: boolean) =>{
 if(available) {
   //Now we know we can send
 }
});

let email = {
  to: 'max@mustermann.de',
  cc: 'erika@mustermann.de',
  bcc: ['john@doe.com', 'jane@doe.com'],
  attachments: [
    'file://img/logo.png',
    'res://icon.png',
    'base64:icon.png//iVBORw0KGgoAAAANSUhEUg...',
    'file://README.pdf'
  ],
  subject: 'Cordova Icons',
  body: 'How are you? Nice greetings from Leipzig',
  isHtml: true
}

// Send a text message using default options
this.emailComposer.open(email);

You can also assign aliases to email apps

// add alias
this.email.addAlias('gmail', 'com.google.android.gm');

// then use alias when sending email
this.email.open({
  app: 'gmail',
  ...
});