{"id":15305157,"url":"https://github.com/eddyverbruggen/nativescript-email","last_synced_at":"2025-10-04T10:30:03.139Z","repository":{"id":31730410,"uuid":"35296361","full_name":"EddyVerbruggen/nativescript-email","owner":"EddyVerbruggen","description":":envelope: NativeScript plugin for opening draft e-mails","archived":false,"fork":false,"pushed_at":"2020-09-06T08:43:44.000Z","size":51,"stargazers_count":47,"open_issues_count":10,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-14T23:12:49.228Z","etag":null,"topics":["email","email-composer","nativescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"NightNord/ljd","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EddyVerbruggen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-08T18:54:59.000Z","updated_at":"2024-05-30T15:52:36.000Z","dependencies_parsed_at":"2022-08-26T01:10:28.310Z","dependency_job_id":null,"html_url":"https://github.com/EddyVerbruggen/nativescript-email","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-email","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-email/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-email/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-email/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EddyVerbruggen","download_url":"https://codeload.github.com/EddyVerbruggen/nativescript-email/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975328,"owners_count":21192210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email","email-composer","nativescript"],"created_at":"2024-10-01T07:59:24.929Z","updated_at":"2025-10-04T10:30:03.048Z","avatar_url":"https://github.com/EddyVerbruggen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NativeScript Email\n\n[![NPM version][npm-image]][npm-url]\n[![Downloads][downloads-image]][npm-url]\n[![Twitter Follow][twitter-image]][twitter-url]\n\n[npm-image]:http://img.shields.io/npm/v/nativescript-email.svg\n[npm-url]:https://npmjs.org/package/nativescript-email\n[downloads-image]:http://img.shields.io/npm/dm/nativescript-email.svg\n[twitter-image]:https://img.shields.io/twitter/follow/eddyverbruggen.svg?style=social\u0026label=Follow%20me\n[twitter-url]:https://twitter.com/eddyverbruggen\n\nYou can use this plugin to compose an e-mail, have the user edit the draft manually, and send it.\n\n\u003e Note that 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](https://github.com/tjvantoll/nativescript-social-share).\n\n\u003e ⚠️ Looking for NativeScript 7 compatibilty? Go to [the NativeScript/plugins repo](https://github.com/NativeScript/plugins/tree/master/packages/email).\n\n## Installation\nRun this command from the root of your project:\n\n```bash\ntns plugin add nativescript-email\n```\n\n## API\n\nTo use this plugin you must first require/import it:\n\n#### TypeScript\n\n```typescript\nimport * as email from \"nativescript-email\";\n// or\nimport { compose } from \"nativescript-email\";\n// or even\nimport { compose as composeEmail } from \"nativescript-email\";\n```\n\n#### JavaScript\n\n```js\nvar email = require(\"nativescript-email\");\n```\n\n### `available`\n\n#### TypeScript\n\n```typescript\n  email.available().then((avail: boolean) =\u003e {\n      console.log(\"Email available? \" + avail);\n  })\n```\n\n#### JavaScript\n\n```js\n  email.available().then(function(avail) {\n      console.log(\"Email available? \" + avail);\n  })\n```\n\n### `compose`\n\n#### JavaScript\n\n```js\n  // let's first create a File object using the tns file module\n  var fs = require(\"file-system\");\n  var appPath = fs.knownFolders.currentApp().path;\n  var logoPath = appPath + \"/res/telerik-logo.png\";\n\n  email.compose({\n      subject: \"Yo\",\n      body: \"Hello \u003cstrong\u003edude\u003c/strong\u003e :)\",\n      to: ['eddyverbruggen@gmail.com', 'to@person2.com'],\n      cc: ['ccperson@somewhere.com'],\n      bcc: ['eddy@combidesk.com', 'eddy@x-services.nl'],\n      attachments: [\n        {\n            fileName: 'arrow1.png',\n            path: 'base64://iVBORw0KGgoAAAANSUhEUgAAABYAAAAoCAYAAAD6xArmAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAHGlET1QAAAACAAAAAAAAABQAAAAoAAAAFAAAABQAAAB5EsHiAAAAAEVJREFUSA1iYKAimDhxYjwIU9FIBgaQgZMmTfoPwlOmTJGniuHIhlLNxaOGwiNqNEypkwlGk9RokoIUfaM5ijo5Clh9AAAAAP//ksWFvgAAAEFJREFUY5g4cWL8pEmT/oMwiM1ATTBqONbQHA2W0WDBGgJYBUdTy2iwYA0BrILDI7VMmTJFHqv3yBUEBQsIg/QDAJNpcv6v+k1ZAAAAAElFTkSuQmCC',\n            mimeType: 'image/png'\n        },\n        {\n            fileName: 'telerik-logo.png',\n            path: logoPath,\n            mimeType: 'image/png'\n      }]\n  }).then(\n    function() {\n      console.log(\"Email composer closed\");\n    }, function(err) {\n      console.log(\"Error: \" + err);\n    });\n```\n\nFull attachment support has been added to 1.3.0 per the example above.\n\nSince 1.4.0 the promise will be rejected in case a file can't be found.\n\n## Usage with Angular\nCheck out [this tutorial (YouTube)](https://www.youtube.com/watch?v=fSnQb9-Gtdk) to learn how to use this plugin in a NativeScript-Angular app.\n\n## Known issues\nOn iOS you can't use the simulator to test the plugin because of an iOS limitation.\nTo prevent a crash this plugin returns `false` when `available` is invoked on the iOS sim.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyverbruggen%2Fnativescript-email","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feddyverbruggen%2Fnativescript-email","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyverbruggen%2Fnativescript-email/lists"}