Html link to mail
You can create an HTML link to send an email using the mailto
protocol. Here's an example:
<a href="mailto:[email protected]">Send email to [email protected]</a>
This will create a link that, when clicked, will open the user's default email client with the address [email protected]
pre-filled in the "To" field.
You can also add additional parameters to the mailto
link to specify the subject, body, and other details. Here are some examples:
- To specify the subject:
<a href="mailto:[email protected]?subject=Hello">Send email to [email protected] with subject "Hello"</a>
- To specify the body:
<a href="mailto:[email protected]?body=Hello%20again">Send email to [email protected] with body "Hello again"</a>
- To specify both the subject and body:
<a href="mailto:[email protected]?subject=Hello&body=Hello%20again">Send email to [email protected] with subject "Hello" and body "Hello again"</a>
Note that the
mailto
protocol is not supported by all email clients, and some clients may not support all of the parameters. Additionally, some email clients may not allow you to send emails using themailto
protocol if the user has not configured their email client to allow it.
It's also worth noting that the mailto
protocol is not secure, as it sends the email address and other information in plain text. If you need to send emails securely, you may want to consider using a different method, such as using a web-based email service or a secure email client.