How to launch and open email client React

I do not want to compose an email. I just want to be able to launch the main email app on a user's device (iOS& Android) from a react-native app.

Scenario: I will send a verification email to the user upon signup.


You can use react natives Linking module for this purpose. Here is a link to the module https://facebook.github.io/react-native/docs/linking.html.

Example: Linking.openURL('mailto:example@gmail.com?subject=example&body=example')


React Native Open Mail Function

<Button onPress={() => Linking.openURL('mailto:support@example.com') }
      title="support@example.com" />

React Native Open URL

<Button onPress={() => Linking.openURL('https://www.google.co.in/') }
      title="www.google.co.in" />

I think the following npm module should have what you're looking for. Unfortunately it uses native libraries so you'll have to run some react-native links.

https://www.npmjs.com/package/react-native-mail

链接地址: http://www.djcxy.com/p/96514.html

上一篇: 如何将自定义项目添加到QFileDialog?

下一篇: 如何启动和打开电子邮件客户端React