Ion2FullApp Ionic Template
Buy Ion2FullAppLive PreviewComments
  • What is Ion2FullApp?
  • About Ion2FullApp
  • Set up
  • Code Structure
  • Customize it
  • Data Integration
  • Nifty Stuff
  • Functionalities
    • Wordpress Integration
    • Firebase Integration
    • AdMob
    • App Rate
    • Multi Language
    • Video Playlist
    • Image Picker
    • Twitter Connect
    • Facebook Connect
    • Google Connect
    • Social Sharing
    • Google Maps
    • Call Number
    • Send email
    • Native Storage
  • Troubleshooting
  • Common Questions
Powered by GitBook
On this page
  1. Functionalities

Send email

Send an email from your Ionic App using one of the mail applications installed in their phone.

PreviousCall NumberNextNative Storage

Last updated 6 years ago

This functionality allows users to send an email using one of the mail applications installed in their phone. Using plugin this functionality can be implemented successfully.

To install run:

$ ionic plugin add --save cordova-plugin-email

$ npm install --save @ionic-native/email-composer

Usage examples:

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);
sendMail(){
    //for more option please go here: http://ionicframework.com/docs/native/email-composer/
     let email = {
      to: 'contact@ionicthemes.com',
      subject: 'This app is the best!',
      body: "Hello, I'm trying this fantastic app that will save me hours of development"
    };
    // Send a text message using default options
    this.emailComposer.open(email);
  }

For more information visit the plugin documentation:

Email Composer
https://ionicframework.com/docs/native/email-composer/