Email Composer
Requires Cordova plugin: cordova-plugin-email-composer. For more info, please see the Email Composer plugin docs.
联系我们?

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic's experts offer official maintenance, support, and integration help.
Ionic Email Composer插件的安装(Installation)
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
Ionic Email Composer插件支持的平台(Supported Platforms)
- Amazon Fire OS
- Android
- Browser
- iOS
- Windows
- macOS
Ionic Email Composer插件的用法(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: '[email protected]',
cc: '[email protected]',
bcc: ['[email protected]', '[email protected]'],
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',
...
});