← #118 Display links in the print mode
#119

Add a subject to a mailto link

Topics: HTML

We already know that when users click a mailto link (<a href="mailto: ___"), the browser will open the default email application and fill the receiver's email address automatically.

Is it possible to fill the initial subject? The answer is yes. We can define it by passing the subject parameter:

<a href="mailto:john@example.com&subject=...">

In addition to the subject parameter, there are also cc, bcc and body parameters. They'll be filled in the default email application if specified.

<a href="mailto:john@example.com&cc=...&bcc=...&body=...">

It's worth noting that the subject and body parameters must replace the spaces with %20. There are some online tool to generate the final mailto link for us.

If you want to use multiple email addresses in the cc and bcc parameters, then separate them with commas (,).

Fix a typo or suggest an improvement
#120 Locate an element with a given selector