简体   繁体   中英

Send an email with a button with no form

Sorry, I have no code that needs fixing, but I'm here to find out if it's possible to do something.

I want the option so when a user clicks Request data it sends an email to 'example@example.com' with a pre-defined message, and then the user gets a message to say the email has sent.

Has anyone done something like this before that can share the code? Tried looking on CodePen but can't find anything.

You can use "mailto" to achieve this.

Haven't tested but you can try this:

<a href="mailto:example@example.com?subject=Mail from Our Site&body=body-goes-here">Email Us</a>  

Going off of this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM