TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Capacitor E-Mail Composer

Maintenance npm

This Plugin is used to open a native E-Mail Composer within your Capacitor App.


This and other Open-Source Cordova/Capacitor Plugins are developed in my free time. To help ensure this plugin is kept updated, new features are added and bugfixes are implemented quickly, please donate a couple of dollars (or a little more if you can stretch) as this will help me to afford to dedicate time to its maintenance. Please consider donating if you're using this plugin in an app that makes you money, if you're being paid to make the app, if you're asking for new features or priority bug fixes.

Table of Content


npm install capacitor-email-composer
npx cap sync


You can add attachments to the draft mail by using the attachments option in the open(...) method. Every attachment needs a type and a path. If you are adding a base64 type attachment, you also need to set the name:

Device Storage

The path to the files must be defined absolute from the root of the file system. On Android the user has to allow the app first to read from external storage!{
  attachments: [{
    type: 'absolute',
    path: 'storage/sdcard/icon.png' // Android

Native resources

Each app has a resource folder, e.g. the res folder for Android apps or the Resource folder for iOS apps. The following example shows how to attach the app icon from within the app's resource folder.{
  attachments: [{
    type: 'resource',
    path: 'icon.png'


The path to the files must be defined relative from the root of the mobile web app assets folder, which is located under the build folder.{
  attachments: [{
    type: 'asset',
    path: '/icon/favicon.png' // starting slash is important


The code below shows how to attach a base64 encoded image which will be added as an image. You must set a name.{
  attachments: [{
    type: 'base64',
    name: 'icon.png' // this is required



hasAccount() => Promise<{ hasAccount: boolean; }>

Checks if the User can send a Mail iOS: Check if the current Device is configured to send mail Android: Currently does nothing

Returns: Promise<{ hasAccount: boolean; }>


open(options?: OpenOptions) => Promise<void>

Open the E-Mail Composer

Param Type Description
options OpenOptions optional Options to prefill the E-Mail



Prop Type Description
to string[] email addresses for TO field
cc string[] email addresses for CC field
bcc string[] email addresses for BCC field
subject string subject of the email
body string email body
isHtml boolean indicates if the body is HTML or plain text (primarily iOS)
attachments Attachment[] attachments that are added to the mail file paths or base64 data streams


Prop Type Description
path string The path of the attachment. See the docs for explained informations.
type 'absolute' | 'resource' | 'asset' | 'base64' The type of the attachment. See the docs for explained informations.
name string The name of the attachment. See the docs for explained informations. Required for base64 attachements.


The full Changelog is available here

Package Sidebar


npm i capacitor-email-composer

Weekly Downloads






Unpacked Size

41 kB

Total Files


Last publish


  • hanskrywaa