<a href="mailto:address?subject=&body=">

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O
Type

When the href attribute of the A element is set as follows, you can set default text for the subject and body of the email.


<a href="mailto:info@example.com?subject=Inquire&body=Your%20message">send mail</a>

Attribute Value Explanation
href=" " mailto:Email address "mailto:" and the Email address

Value details

info@example.com?subject=Inquire&body=Your%20message

  • ? : The email address is separated from the other information by a "?".
  • subject= : Specifies the subject of the email.
  • body= : Specifies the body text of the email.
  • & : The subject and body are separated by a "&".
  • %20 : Spaces between words.

Other values

The "CC" and "BCC" can also be specified.

info@example.com?cc=cc@example.com&bcc=bcc@example.com&subject=Inquire&body=Your%20message

  • cc= : Specifies the CC (Carbon Copy) address.
  • bcc= : Specifies the BCC (Blind Carbon Copy) address.

Example

The email address is a dummy. Please do not send email to the dummy address.

Subject

<p><a href="mailto:info@example.com?subject=Inquire">Open the email client</a></p>

Output

Open the email client

Body

<p><a href="mailto:info@example.com?body=Your%20message">Open the email client</a></p>

Output

Open the email client

Subject and Body

<p><a href="mailto:info@example.com?subject=Inquire&body=Your%20message">Open the email client</a></p>

Output

Open the email client

CC and BCC

<p><a href="mailto:info@example.com?cc=cc@example.com&bcc=bcc@example.com">Open the email client</a></p>

Output

Open the email client

Everything is specified

<p><a href="mailto:info@example.com?cc=cc@example.com&bcc=bcc@example.com&subject=Inquire&body=Your%20message">Open the email client</a></p>

Output

Open the email client