Email with React Native iOS

I need to be able to send emails using native response.

The user enters text data into the form and presses the submit button, the text must then be copied to a new email and sent to an address where I can view the data. It will always be sent to the same address.

So, basically I need to send emails from the application, while the sender and recipient address remains the same for each user. (Not selected by user or anything)

I was looking for various modules that seem to be able to do this, but so far no one has worked with the native reaction (i.e. https://nodemailer.com )

What I don't need is the standard iOS email hint that appears (as in this module https://www.npmjs.com/package/react-native-communications ). It should always run in the background, without the user even knowing that the email was sent, simply confirming that the data was sent.

+4
source share
2 answers

Unfortunately, iOS does not support email messages by default.

What you can do is make an XHR request to your server with the necessary data and process the distribution procedure on the server.

You will probably find more convenient information here:

UPD: iphone smtp . , , , SMTP JS-. , .

+2

npm, .

https://github.com/ErickMaeda/react-native-email-action

, - .

:

npm install --save react-native-email-action

import { sendEmail } from 'react-native-email-action';

const options = {
  to: "erick.maeda26@gmail.com", 
  subject: "Very important!", 
  body: "Verify your email fast!"
};
sendMail(options);

iOS 9+, Info.plist

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>message</string>
  <string>ms-outlook</string>
  <string>googlegmail</string>
</array>    
0

All Articles