Links

Send email

Send an email from your Ionic App using one of the mail applications installed in their phone.
This functionality allows users to send an email using one of the mail applications installed in their phone. Using Email Composer 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 = {
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 = {
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: https://ionicframework.com/docs/native/email-composer/