Preview 2.0 is now in Public Beta!
Read the Announcement


You can use this plugin to compose an e-mail, have the user edit the draft manually, and send it.


This plugin depends on the default mail app. If you want a fallback to a third party client app like Gmail or Outlook, then check for availability, and if not available use a solution like the Social Share plugin.


npm install @nativescript/email



Once you've installed the plugin, the next step is to import it before using it.

import * as email from '@nativescript/email'
// or
import { compose } from '@nativescript/email'
// or even
import { compose as composeEmail } from '@nativescript/email'

Checking the availability

To check if the device has a mail app installed, call the available method.

email.available().then((avail: boolean) => {
  console.log('Email available? ' + avail)

Composing an email

To compose an email, use the compose method.

// let's first create a File object
import { knownFolders } from '@nativescript/core'
var appPath = knownFolders.currentApp().path
var logoPath = appPath + '/res/telerik-logo.png'

    subject: 'Yo',
    body: 'Hello <strong>dude</strong> :)',
    to: ['[email protected]', '[email protected]'],
    cc: ['[email protected]'],
    bcc: ['[email protected]', '[email protected]'],
    attachments: [
        fileName: 'arrow1.png',
        mimeType: 'image/png'
        fileName: 'telerik-logo.png',
        path: logoPath,
        mimeType: 'image/png'
    function () {
      console.log('Email composer closed')
    function (err) {
      console.log('Error: ' + err)



NameReturn TypeDescription
available()Promise<boolean>Checks for availability of a mail app.
compose(options: ComposeOptions)Promise<boolean>Composes and sends a ComposeOptions email.


fileNamestringThe name used for the attachment.
Example: fileName: 'Cute-Kitten.png'
pathstringThe to the file to be attached.
mimeTypestring(iOS-only)Used to help the iOS device figure out how to send the file.Example:mimeType: 'image/png'


subjectstringOptional: The subject of the email.
bodystringOptional: The body of the email. The plugin will automatically handle plain and html email content.
bodystringOptional: The body of the email. The plugin will automatically handle plain and html email content.
tostring[]Optional: An array of email addresses of the direct recipients. On Android only the first item in the array is used.
ccstring[]Optional: An array of email addresses of the cc recipients.
bccstring[]Optional: An array of email addresses of the bcc recipients.
attachmentsArray<Attachment>The files to be attached to the email.
iosViewControlleranyOptional: (iOS-only) iOS View Controller to open compose from.

Usage with Angular

Check out this tutorial (YouTube) to learn how to use this plugin in a NativeScript-Angular app.

Known issues

On iOS you can't use the simulator to test the plugin because of an iOS limitation. To prevent a crash, this plugin returns false when available is invoked on the iOS simulator.


Apache License Version 2.0