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.
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: