3

I can't figure out how to send an HTML formatted Email from React-Native. I have tried with both React-Native-Communications and React-Native-Mail but both cause the html tags to appear as text in the email body. I even set the isHTML flag to true in RN-mail and it did not help on Android (haven't tested iOS though). How can I do this?

3
  • <a href="mailto:[email protected]">Mail</a> en.wikipedia.org/wiki/Mailto Commented Mar 24, 2017 at 16:11
  • As far as Google and I know mailto doesn't support hmtl formatted body text Commented Mar 24, 2017 at 16:17
  • Not sure if this is language-specific, but it can be done on the server-side using php's mail function as well. Commented Mar 24, 2017 at 18:52

1 Answer 1

0

I haven't used React-Native-Communications and React-Native-Mail (ones that you mentioned), but since React Native is also a node based framework, you can try using https://github.com/andris9/Nodemailer library. It sure sends html content in mails. and to help you get started, you can use this answer with example usage of this module. Even you can seperate it in a component of your own later on to maintain modularity. I hope it helped.

Sign up to request clarification or add additional context in comments.

2 Comments

Sorry, I didn't mean that I want to send the mail directly with the app but rather that I want to invoke the creation of a new mail in the default mail app so that the user can send it from his own address
According to RFC 2368 document that I came across, it seems its not possible to embed HTML content in mailto URL scheme. Here 's the link for more info on this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.