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)
yarn add react-native-email-actionAfter 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>import { sendEmail } from 'react-native-email-action';
const options = {
to: 'erick.maeda26@gmail.com',
subject: 'Very important!',
body: 'Verify your email fast!',
};
sendEmail(options);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: 'user@example.com',
subject: 'Subject',
body: 'Body',
appIds: ['gmail', 'outlook', 'spark'],
});| 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 |
- 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
- All the apps installed.
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>- 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
