How to open mail id in gmail using html link

To open a Gmail mailbox using an HTML link, you can use the following format:

<a href="mailto:[email protected]">Open Mailbox</a>

Replace [email protected] with the actual Gmail address you want to open.

This will create a link that, when clicked, will open the default email client on the user's device and compose a new email to the specified address.

If you want to open a specific mailbox (e.g., inbox, sent, drafts, etc.), you can use the following format:

<a href="mailto:[email protected]?label=inbox">Open Inbox</a>

Replace [email protected] with the actual Gmail address and inbox with the mailbox you want to open (e.g., sent, drafts, spam, etc.).

Note that the label parameter is only supported in Gmail and will not work with other email providers.

You can also use the subject and body parameters to prefill the email composition:

<a href="mailto:[email protected]?subject=Hello&body=Hello%20World!">Compose Email</a>

This will open a new email composition window with the subject "Hello" and body "Hello World!".

Keep in mind that these links will only work if the user has a default email client set up on their device. If the user doesn't have a default email client, the link will not work.