Gmail compose mailto body
A clever question!
When you click the "Compose" button in Gmail, it opens a new email composition window. By default, the body of the email is empty. However, you can use the mailto
protocol to pre-populate the body of the email with a default message.
Here's the syntax:
mailto:[email protected]?subject=Subject&body=Body%20text
Replace:
[email protected]
with the email address of the recipientSubject
with the subject of the emailBody text
with the default text you want to appear in the email body
For example:
mailto:[email protected]?subject=Hello&body=Hi%20John,%20this%20is%20a%20test%20email.
When you click the link, Gmail will open a new email composition window with the recipient's email address, subject, and body text pre-filled.
Note that you can also use HTML entities to format the body text, such as <
for <
and >
for >
. For example:
mailto:[email protected]?subject=Hello&body=Hi%20John,<b>this%20is%20a%20test%20email</b>.
This would render as a bold text in the email body.
Keep in mind that the mailto
protocol is not supported by all email clients, and some may not work as expected. Additionally, some email clients may strip out certain characters or formatting from the body text.