react-native-email-action
v1.1.0
Published
A simple and customized way to open email linking (Best option for iOS that will ask you what email provider you can use)
Maintainers
Readme
React Native Email Action
A simple and customized way to open email linking (Best option for iOS that will ask you what email app you can use, if installed)
Demo (iOS)

Installation
yarn add react-native-email-actioniOS Only
After iOS 9+, you need to add this information keys on Info.plist
<key>LSApplicationQueriesSchemes</key>
<array>
<string>message</string>
<string>ms-outlook</string>
<string>googlegmail</string>
</array>Usage
import { sendEmail } from 'react-native-email-action';
const options = {
to: '[email protected]',
subject: 'Very important!',
body: 'Verify your email fast!',
};
sendEmail(options);Configuring Available Email Apps
By default, the library checks for Mail, Outlook, and Gmail. You can customize which email apps are available by using the configureEmailApps function:
import { sendEmail, configureEmailApps } from 'react-native-email-action';
// Enable specific email apps
configureEmailApps(['mail', 'gmail', 'outlook', 'spark', 'airmail']);
// Or pass appIds directly to sendEmail for one-off usage
sendEmail({
to: '[email protected]',
subject: 'Subject',
body: 'Body',
appIds: ['gmail', 'outlook', 'spark'],
});Available Options to sendMail
| | description | type | required | | ------- | -------------------- | ------ | -------- | | to | Email to destination | string | Y | | subject | Email Subject | string | Y | | body | Email Content | string | Y | | cc | Email CC | array | N | | bcc | Email BCC | array | N |
Available email apps
iOS (If installed)
- Gmail
- Outlook
- Spark
- Airmail
- Superhuman
- Yahoo Mail
- Fastmail
- ProtonMail
You can use any of these app IDs when calling configureEmailApps(): mail, gmail, outlook, spark, airmail, superhuman, ymail, fastmail, protonmail
Android
- All the apps installed.
iOS Configuration
After iOS 9+, you need to add the URL schemes for the email apps you want to support in your Info.plist:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>message</string>
<!-- iOS configuration details are consolidated below -->
<string>ms-outlook</string>
<string>googlegmail</string>
<string>readdle-spark</string>
<string>airmail</string>
</array>Roadmap
API
- sendEmail(options): Opens the email composer. On iOS, shows an action sheet listing available apps based on
configureEmailApps()oroptions.appIds. - configureEmailApps(appIds): Sets the default list of email apps to check on iOS. Use app IDs from the list below.
- ~~Add other app emails for iOS~~ ✅ Done! (configurable)
- Add attachment option
