I want to show a pop-up like this click here in my react application. In simple words, I want to launch and open the email client in ReactJs. I am currently using a simple p tag:
<p className="cnct_email_addr">Email US</p>
I know there is a way to use mailto like this:
<a href="mailto:[email protected]">Email Us</a>
But I want to know if there is a more reactish-way of doing it. If there is one please let me know.
import { Linking } from 'react-native' React Native Open Mail <TouchableOpacity onPress={() => Linking. openURL('mailto:[email protected]')}> <Text>[email protected]</Text> </TouchableOpacity> React Native Open Mail With Subject & Body <TouchableOpacity onPress={() => Linking.
React-MailTo - CodeSandbox. <Mailto email="[email protected]" subject="Hello" body="Hello world!"> Mail me! You need to enable JavaScript to run this app.
<a href="mailto:address"> When the href attribute of the A element is set as follows, users can open the email client by clicking that link.
You can open the mailto
link using window
window.open('mailto:[email protected]?subject=Subject&body=Body%20goes%20here')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With