I am progromming about function: send Email to gmail Address directly from React native App. I searched on Internet and try library: https://github.com/anarchicknight/react-native-communications, https://github.com/chirag04/react-native-mail. Howerver, they only show me view of Gmail App which I installed in my device. I want react native app will send directly to Address Email. My device I tested run on Android Platform. Thank you so much
2 Answers
You need an email server or an email services to send an email, there is no way you can send an email directly from the client side.
There are several of them in the internet, you can try: MailGun or SendPulse, they got some good free tiers.
Your job is just calling a simple POST method from your app to their APIs.

- 6,841
- 9
- 61
- 102

- 1,462
- 11
- 26
-
There is other options like https://blog.mailtrap.io/react-native-send-email – Philip Enc Dec 23 '19 at 21:12
I have tried, and so far succeeded in testing with iOS, with react-native-email ("npm install react-native-email").
There is a bit of fluffing around when sending the first email as you have to "login" to your email account. But otherwise, test emails are going through fine.
Also, SendPulse is a bulk newsletter service, not for individual emails.
One annoying caveat: it won't work in your emulator. It will return a URL error when you click the send button. But it works fine on a real device. I'm using Expo (and who wouldn't) and it works fine on my iPhone.
Complete code for testing purposes here: https://github.com/tiaanduplessis/react-native-email

- 433
- 6
- 18
-
You should rethink using expo for anything but small fun apps, cf https://medium.com/better-programming/how-expo-is-fooling-everyone-adf7f34d7528 – Nicolas Bernard May 15 '20 at 01:48