How To Use Email Composer Ionic 2?


#1

Usage

Preformatted textimport { EmailComposer } from ‘ionic-native’;

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
EmailComposer.open(email);Preformatted text

where I should put that code in my project? and in my html, I must write what? Thank You.