react-native-email
Send a email using the Linking API
Table of Contents
Table of Contents
Install
Usage
Contribute
License
Install
$ npm install react-native-email
$ yarn add react-native-email
Usage
import React from 'react'
import { StyleSheet, Button, View } from 'react-native'
import email from 'react-native-email'
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Button title="Send Mail" onPress={this.handleEmail} />
</View>
)
}
handleEmail = () => {
const to = ['tiaan@email.com', 'foo@bar.com']
email(to, {
cc: ['bazzy@moo.com', 'doooo@daaa.com'],
bcc: 'mee@mee.com',
subject: 'Show how to use',
body: 'Some body right here'
}).catch(console.error)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center'
}
})
This results to:
Contributing
Contributions are welcome!
- Fork it.
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Or open up a issue.
License
Licensed under the MIT License.