How to create compose mail link

To create a compose mail link, you can use the following format:

mailto:[email protected]?subject=Subject&body=Body

Here's a breakdown of the components:

For example, if you want to create a compose mail link to send an email to [email protected] with the subject Hello and the body This is a test email, you would use the following code:

mailto:[email protected]?subject=Hello&body=This%20is%20a%20test%20email

Note that you need to URL-encode any special characters in the subject and body using the % symbol. For example, if you want to include a space in the body, you would replace it with %20.

You can also add additional parameters to the link to customize the email composition experience. For example:

Here's an example of a compose mail link with multiple parameters:

mailto:[email protected]?subject=Hello&body=This%20is%20a%20test%20email&[email protected]&[email protected]&attachment=file.txt

Keep in mind that the availability of these parameters may vary depending on the email client and device being used.